Method from org.apache.openejb.webadmin.httpd.HttpRequestImpl Detail: |
protected String getCookie(String name) {
return (String) getCookies().get(name);
}
|
protected HashMap getCookies() {
if (cookies != null) return cookies;
cookies = new HashMap();
String cookieHeader = getHeader(HEADER_COOKIE);
if (cookieHeader == null ) return cookies;
StringTokenizer tokens = new StringTokenizer(cookieHeader, ";");
while (tokens.hasMoreTokens()){
StringTokenizer token = new StringTokenizer(tokens.nextToken(),"=");
String name = token.nextToken();
String value = token.nextToken();
cookies.put(name, value);
}
return cookies;
}
|
public String getFormParameter(String name) {
return (String) formParams.get(name);
}
Gets a form parameter based on the name passed in. |
public String[][] getFormParameters() {
Iterator keys = formParams.keySet().iterator();
String[][] returnValue = new String[formParams.size()][2];
String temp;
int i = 0;
while (keys.hasNext()) {
temp = (String) keys.next();
returnValue[i][0] = temp;
returnValue[i++][1] = (String) formParams.get(temp);
}
return returnValue;
}
Gets all the form parameters in the form of a two-dimentional array
The second dimention has two indexes which contain the key and value
for example:
for(int i=0; i
All values are strings |
public String getHeader(String name) {
return (String) headers.get(name);
}
Gets a header based the header name passed in. |
public int getMethod() {
return method;
}
Gets an integer value of the request method. These values are:
OPTIONS = 0
GET = 1
HEAD = 2
POST = 3
PUT = 4
DELETE = 5
TRACE = 6
CONNECT = 7
UNSUPPORTED = 8 |
public String getMethodString() {
return methodString;
}
|
public String getPathString() {
return pathString;
}
|
public String getQueryParameter(String name) {
return (String) queryParams.get(name);
}
Gets a URL (or query) parameter based on the name passed in. |
protected String getRequestLine() {
return requestLine;
}
|
public HttpSession getSession() {
return getSession(true);
}
|
public HttpSession getSession(boolean create) {
if (session != null) return session;
String id = getCookie(EJBSESSIONID);
if (id != null) {
session = (WebSession)sessions.get(id);
}
if (session == null && create){
session = createSession();
sessions.put(session.getId(), session);
}
return session;
}
|
public URL getURI() {
return uri;
}
Gets the URI for the current URL page. |
protected void readMessage(InputStream input) throws IOException {
DataInput in = new DataInputStream(input);
readRequestLine(in);
readHeaders(in);
readBody(in);
}
parses the request into the 3 different parts, request, headers, and body |