cx.ath.matthew.cgi
public abstract class CGI extends Object
| Method Summary | |
|---|---|
| protected abstract void | cgi(Map POST, Map GET, Map ENV, Map COOKIES, String[] params)
Override this method in your CGI program.
|
| void | doCGI(String[] args)
This method sets up all the CGI variables and calls the cgi() method, then writes out the page data. |
| void | flush()
Flushes the output.
|
| OutputStream | getOutputStream()
This will return an OutputStream that you can write data
directly to. |
| void | header(String variable, String value)
Called by CGIs to send a header to the output
|
| void | out(byte[] data)
Called by CGIs to send byte data to the output.
|
| void | out(String data)
Called by CGIs to send a string to the output.
|
| void | setcookie(String variable, String value, String path, String domain, Date expires, boolean secure)
Sets a Cookie in the web browser, with extended attributes.
|
| void | setcookie(String variable, String value)
Sets a Cookie in the web browser.
|
| protected void | setErrorHandler(CGIErrorHandler handler)
Sets a custom exception handler.
|
Parameters: POST A Map of variable =$gt; value for the POST variables. GET A Map of variable =$gt; value for the GET variables. ENV A Map of variable =$gt; value for the Webserver environment variables. COOKIES A Map of variable =$gt; value for the browser-sent cookies. params An array of parameters passed to the CGI (GET with no variable assignments)
Throws: Exception You can throw anything, it will be caught by the error handler.
See Also: CGI
Returns: an OutputStream
See Also: CGI
Parameters: variable The header variable to set. value The value of the variable.
Throws: CGIHeaderSentException if the headers have already been sent.
See Also: CGI
Parameters: data The page data.
Throws: CGIInvalidContentFormatException if text data has already been sent.
See Also: CGI
Parameters: data The page data.
Throws: CGIInvalidContentFormatException if raw data has already been sent.
See Also: CGI
Parameters: variable The cookie variable to set. value The value of the variable. path The path that the cookie will be returned for. domain The domain that the cookie will be returned for. expires The expiry date of the cookie. secure Will only send the cookie over HTTPS if this is true.
Throws: CGIHeaderSentException if the headers have already been sent.
Parameters: variable The cookie variable to set. value The value of the variable.
Throws: CGIHeaderSentException if the headers have already been sent.
Parameters: handler The new exception handler