|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.net.CGI
This class is an interface to the Common Gateway Interface protocol used by most Unix based HTTP servers. It will take the values of an HTML form and make them available to the program through the getFormData() method. Supports data submitted via via http post, http put, http get and http isindex. Don't support all isindex queries. Support queries with path?name=value pairs, but not path?a+b+c
By itself, a java program cannot be used as a CGI program for two reasons:
The parsing of the CGI protocol stuff is done by the constructor of this class.
If this class is used in an interactive (testing) environment, requests for values will cause a interactive prompts. Once the value has been entered once, it is not asked for again. This is useful for debugging purposes.
Method Summary | |
java.lang.String |
decodeURL(java.lang.String URL)
Convert an URL-escaped string to a non-escaped string. |
java.lang.String |
getBaseURL()
Returns the Base URL of this script. |
java.util.Properties |
getCGIEnvironmentVariables()
Returns a hashtable containing name-value pairs of the cgi environment variables. |
java.util.Properties |
getFormData()
Returns a hashtable containing name-value pairs of the data sent via http post, http put, http get and http isindex. |
java.lang.String |
getFullURL()
Returns the full URL of this script. |
static CGI |
getInstance()
Returns a CGI object |
boolean |
isGetRequest()
Returns true if this is a get request |
boolean |
isPostRequest()
Returns true if this is a post request |
boolean |
isPutRequest()
Returns true if this is a put request |
void |
sendHtml(java.lang.String htmlMessage)
Send an html encoded message to the client. |
static void |
sendRedirect(java.lang.String url)
Sends a url to client to use unstead of current url. |
void |
sendText(java.lang.String textMessage)
Send a text message to the client. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static CGI getInstance()
public java.util.Properties getFormData()
public java.util.Properties getCGIEnvironmentVariables()
AUTH_TYPE | HTTP_ACCEPT | REMOTE_ADDR | SCRIPT_NAME |
CONTENT_LENGTH | HTTP_USER_AGENT | REMOTE_HOST | SERVER_NAME |
CONTENT_TYPE | PATH_INFO | REMOTE_IDENT | SERVER_PORT |
DOCUMENT_ROOT | PATH_TRANSLATED | REMOTE_USER | SERVER_PROTOCOL |
GATEWAY_INTERFACE | QUERY_STRING | REQUEST_METHOD | SERVER_SOFTWARE |
public java.lang.String getBaseURL()
public java.lang.String getFullURL()
public boolean isPostRequest()
public boolean isGetRequest()
public boolean isPutRequest()
public void sendText(java.lang.String textMessage)
public void sendHtml(java.lang.String htmlMessage)
public static void sendRedirect(java.lang.String url)
public java.lang.String decodeURL(java.lang.String URL)
URL
- the escaped string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |