Quadcap Embeddable Server

com.quadcap.http.server22.HttpRequest Class Reference

Inheritance diagram for com.quadcap.http.server22.HttpRequest:

HttpServletRequest List of all members.

Detailed Description

This class encapsulates the information that makes up a single HTTP request, including the method, URI, and the headers.

Author:
Stan Bailes

Definition at line 85 of file HttpRequest.java.

Public Member Functions

 HttpRequest (WebWorker w)
 Using the specified worker's input stream, read an HTTP request, and construct a new HttpRequest object to represent it.

void reset (HttpInputStream is) throws IOException
 Reset the request object and bind it to the input stream.

void setURI (String s)
int getContentLength ()
 Returns the size of the request entity data, or -1 if not known.

String getContentType ()
 Returns the Internet Media Type of the request entity data, or null if not known.

String getProtocol ()
 Returns the protocol and version of the request as a string of the form <protocol>/<major version>.<minor version&gt.

String getScheme ()
 Returns the scheme of the URL used in this request, for example "http", "https", or "ftp".

String getServerName ()
 Returns the host name of the server that received the request.

int getServerPort ()
 Returns the port number on which this request was received.

String getRemoteAddr ()
 Returns the IP address of the agent that sent the request.

String getRemoteHost ()
 Returns the fully qualified host name of the agent that sent the request.

String getRealPath (String path)
 Applies alias rules to the specified virtual path and returns the corresponding real path, or null if the translation can not be performed for any reason.

ServletInputStream getInputStream () throws IOException
 Returns an input stream for reading binary data in the request body.

String getParameter (String name)
 Returns a string containing the lone value of the specified parameter, or null if the parameter does not exist.

String[] getParameterValues (String name)
 Returns the values of the specified parameter for the request as an array of strings, or null if the named parameter does not exist.

Enumeration getParameterNames ()
 Returns the parameter names for this request as an enumeration of strings, or an empty enumeration if there are no parameters or the input stream is empty.

Object getAttribute (String name)
 Returns the value of the named attribute of the request, or null if the attribute does not exist.

void setAttribute (String name, Object obj)
 Set the value of the named attribute.

Enumeration getAttributeNames ()
 Return an enumeration of all attribute names of this service.

void removeAttribute (String name)
 Remove an attribute from the request.

BufferedReader getReader () throws IOException
 Returns a buffered reader for reading text in the request body.

String getCharacterEncoding ()
 Returns the character set encoding for the input of this request.

Cookie[] getCookies ()
 Gets the array of cookies found in this request.

String getMethod ()
 Gets the HTTP method (for example, GET, POST, PUT) with which this request was made.

String getRequestURI ()
 Gets, from the first line of the HTTP request, the part of this request's URI that is to the left of any query string.

String getServletPath ()
 Gets the part of this request's URI that refers to the servlet being invoked.

String getPathInfo ()
 Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string.

String getPathTranslated ()
 Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string, and translates it to a real path.

String getQueryString ()
 Gets any query string that is part of the HTTP request URI.

String getRemoteUser ()
 Gets the name of the user making this request.

String getAuthType ()
 Gets the authentication scheme of this request.

String getHeader (String name)
 Gets the value of the requested header field of this request.

int getIntHeader (String name)
 Gets the value of the specified integer header field of this request.

long getDateHeader (String name)
 Gets the value of the requested date header field of this request.

Enumeration getHeaders ()
 Gets the header names for this request.

Enumeration getHeaders (String name)
Enumeration getHeaderNames ()
HttpSession getSession (boolean create)
 Gets the current valid session associated with this request, if create is false or, if necessary, creates a new session for the request, if create is true.

HttpSession getSession ()
 Gets the current valid session associated with this request, and if necessary, creates a new session for the request.

String getRequestedSessionId ()
 Gets the session id specified with this request.

boolean isRequestedSessionIdValid ()
 Checks whether this request is associated with a session that is valid in the current session context.

boolean isRequestedSessionIdFromCookie ()
 Checks whether the session id specified by this request came in as a cookie.

boolean isRequestedSessionIdFromURL ()
 Checks whether the session id specified by this request came in as part of the URL.

boolean isRequestedSessionIdFromUrl ()
String getContextPath ()
 Return the portion of the request URI that specifies the context for this request.

boolean isUserInRole (String role)
 Returns a boolean indicating whether the authenticated user is included in the indicated 'role'.

Principal getUserPrincipal ()
 Return a Principal object indicating the identity of the user associated with this request.

Locale getLocale ()
 Return the preferred Locale that the client will accept content from based on the Accept-Language header, or the server default Locale.

Enumeration getLocales ()
RequestDispatcher getRequestDispatcher (String path)
boolean isSecure ()

Static Public Member Functions

void parseParameters (Hashtable params, InputStream is)
 Parse a set of parameters from the specified input stream.

void parseParameters (Hashtable params, Scanner s)

Package Functions

final void maybeParsePostData ()
boolean badRequest ()
String getToken (OctetMap map) throws IOException
 Parsing helper: Get the next bytes all of which are in the specified map.

String parseHttpVersion () throws IOException
 Parse the http version field from the request line.

void setResponse (HttpResponse res)
 Associate this request with its matching response.

final Locale makeLocale (String s)
final float getLangQual (String s)
final int compareAccept (String a, String b)
final void setRequestDispatcher (HttpDispatcher rd)

Static Package Functions

 [static initializer]
final String urlDecode (String s)

Package Attributes

WebWorker w
HttpResponse res
HttpInputStream his
HttpDispatcher rd
HSession session = null
BufferedReader reader = null
Scanner scanner
String method = null
String uri = null
String pathInfo = null
String queryString = null
int queryStringStart = 0
int queryStringLen = 0
String protocol = null
byte[] headers = new byte[4096]
int[] hOffsets = new int[32]
Hashtable parameters = new Hashtable()
Hashtable attributes = null
boolean getInputStreamCalled = false
boolean getReaderCalled = false
Cookie[] cookies = null
boolean badRequest = false

Static Package Attributes

OctetMap mapM = new OctetMap('&')
OctetMap mapE = new OctetMap('=')
OctetMap mapQuote = new OctetMap('"')
DateFormat dateFormat = DateFormat.getInstance()
final int CR = '\r'
final String methodGET = "GET"
final String methodHEAD = "HEAD"
final String methodPOST = "POST"
final String proto_09 = "HTTP/0.9"
final String proto_10 = "HTTP/1.0"
final String proto_11 = "HTTP/1.1"
OctetMap versionMap = new OctetMap("HhTtPp/1.0")


Constructor & Destructor Documentation

com.quadcap.http.server22.HttpRequest.HttpRequest WebWorker  w  ) 
 

Using the specified worker's input stream, read an HTTP request, and construct a new HttpRequest object to represent it.

Parameters:
w the worker

Definition at line 137 of file HttpRequest.java.


Member Function Documentation

com.quadcap.http.server22.HttpRequest.[static initializer]  )  [static, package]
 

boolean com.quadcap.http.server22.HttpRequest.badRequest  )  [package]
 

Definition at line 268 of file HttpRequest.java.

final int com.quadcap.http.server22.HttpRequest.compareAccept String  a,
String  b
[package]
 

Definition at line 1083 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.compareAccept().

Referenced by com.quadcap.http.server22.HttpRequest.compareAccept().

Object com.quadcap.http.server22.HttpRequest.getAttribute String  name  ) 
 

Returns the value of the named attribute of the request, or null if the attribute does not exist.

Parameters:
name the name of the attribute whose value is required

Definition at line 450 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.attributes, and com.quadcap.http.server22.HttpRequest.getAttribute().

Referenced by com.quadcap.http.server22.HttpRequest.getAttribute().

Enumeration com.quadcap.http.server22.HttpRequest.getAttributeNames  ) 
 

Return an enumeration of all attribute names of this service.

Definition at line 470 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.attributes.

String com.quadcap.http.server22.HttpRequest.getAuthType  ) 
 

Gets the authentication scheme of this request.

Same as the CGI variable AUTH_TYPE.

Returns:
this request's authentication scheme, or null if none.

Definition at line 658 of file HttpRequest.java.

String com.quadcap.http.server22.HttpRequest.getCharacterEncoding  ) 
 

Returns the character set encoding for the input of this request.

Definition at line 508 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getContentType().

int com.quadcap.http.server22.HttpRequest.getContentLength  ) 
 

Returns the size of the request entity data, or -1 if not known.

Same as the CGI variable CONTENT_LENGTH.

Definition at line 294 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getHeader().

Referenced by com.quadcap.http.server22.HttpRequest.reset().

String com.quadcap.http.server22.HttpRequest.getContentType  ) 
 

Returns the Internet Media Type of the request entity data, or null if not known.

Same as the CGI variable CONTENT_TYPE.

Definition at line 308 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getHeader().

Referenced by com.quadcap.http.server22.HttpRequest.getCharacterEncoding(), and com.quadcap.http.server22.HttpRequest.maybeParsePostData().

String com.quadcap.http.server22.HttpRequest.getContextPath  ) 
 

Return the portion of the request URI that specifies the context for this request.

Definition at line 1013 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getContextPath(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.HttpRequest.getSession(), and com.quadcap.http.server22.WebWorker.showException().

Cookie [] com.quadcap.http.server22.HttpRequest.getCookies  ) 
 

Gets the array of cookies found in this request.

Returns:
the array of cookies found in this request

Definition at line 536 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.cookies, com.quadcap.http.server22.HttpRequest.getHeader(), and com.quadcap.http.server22.CookieParser.parseCookies().

Referenced by com.quadcap.http.server22.HttpRequest.getRequestedSessionId().

long com.quadcap.http.server22.HttpRequest.getDateHeader String  name  ) 
 

Gets the value of the requested date header field of this request.

If the header can't be converted to a date, the method throws an IllegalArgumentException. The case of the header field name is ignored.

Parameters:
name the String containing the name of the requested header field
Returns:
the value the requested date header field, or -1 if not found.

Definition at line 720 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.dateFormat, and com.quadcap.http.server22.HttpRequest.getDateHeader().

Referenced by com.quadcap.http.server22.HttpRequest.getDateHeader().

String com.quadcap.http.server22.HttpRequest.getHeader String  name  ) 
 

Gets the value of the requested header field of this request.

The case of the header field name is ignored.

Parameters:
name the String containing the name of the requested header field
Returns:
the value of the requested header field, or null if not known.

Definition at line 671 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getHeader(), com.quadcap.http.server22.HttpRequest.headers, and com.quadcap.http.server22.HttpRequest.hOffsets.

Referenced by com.quadcap.http.server22.WebWorker.doSession(), com.quadcap.http.server22.HttpRequest.getContentLength(), com.quadcap.http.server22.HttpRequest.getContentType(), com.quadcap.http.server22.HttpRequest.getCookies(), and com.quadcap.http.server22.HttpRequest.getHeader().

Enumeration com.quadcap.http.server22.HttpRequest.getHeaderNames  ) 
 

Definition at line 764 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.headers, and com.quadcap.http.server22.HttpRequest.hOffsets.

Referenced by com.quadcap.http.server22.HttpRequest.getHeaders(), and com.quadcap.http.server22.WebWorker.showException().

Enumeration com.quadcap.http.server22.HttpRequest.getHeaders String  name  ) 
 

Definition at line 747 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.headers, and com.quadcap.http.server22.HttpRequest.hOffsets.

Enumeration com.quadcap.http.server22.HttpRequest.getHeaders  ) 
 

Gets the header names for this request.

Returns:
an enumeration of strings representing the header names for this request. Some server implementations do not allow headers to be accessed in this way, in which case this method will return null.

Definition at line 743 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getHeaderNames().

Referenced by com.quadcap.http.server22.WebWorker.showException().

ServletInputStream com.quadcap.http.server22.HttpRequest.getInputStream  )  throws IOException
 

Returns an input stream for reading binary data in the request body.

Exceptions:
IllegalStateException if getReader has been called on this same request.
IOException on other I/O related errors.

Definition at line 387 of file HttpRequest.java.

References com.quadcap.http.server22.WebWorker.getHttpInputStream(), com.quadcap.http.server22.HttpRequest.getInputStreamCalled, com.quadcap.http.server22.HttpRequest.getReaderCalled, and com.quadcap.http.server22.HttpRequest.w.

Referenced by com.quadcap.http.server22.HttpRequest.getReader().

int com.quadcap.http.server22.HttpRequest.getIntHeader String  name  ) 
 

Gets the value of the specified integer header field of this request.

The case of the header field name is ignored. If the header can't be converted to an integer, the method throws a NumberFormatException.

Parameters:
name the String containing the name of the requested header field
Returns:
the value of the requested header field, or -1 if not found.

Definition at line 700 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getIntHeader().

Referenced by com.quadcap.http.server22.HttpRequest.getIntHeader().

final float com.quadcap.http.server22.HttpRequest.getLangQual String  s  )  [package]
 

Definition at line 1070 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getLangQual().

Referenced by com.quadcap.http.server22.HttpRequest.getLangQual().

Locale com.quadcap.http.server22.HttpRequest.getLocale  ) 
 

Return the preferred Locale that the client will accept content from based on the Accept-Language header, or the server default Locale.

Definition at line 1038 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.makeLocale().

Enumeration com.quadcap.http.server22.HttpRequest.getLocales  ) 
 

Definition at line 1091 of file HttpRequest.java.

String com.quadcap.http.server22.HttpRequest.getMethod  ) 
 

Gets the HTTP method (for example, GET, POST, PUT) with which this request was made.

Same as the CGI variable REQUEST_METHOD.

Returns:
the HTTP method with which this request was made

Definition at line 555 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.method.

Referenced by com.quadcap.http.server22.WebWorker.doSession().

String com.quadcap.http.server22.HttpRequest.getParameter String  name  ) 
 

Returns a string containing the lone value of the specified parameter, or null if the parameter does not exist.

For example, in an HTTP servlet this method would return the value of the specified query string parameter. Servlet writers should use this method only when they are sure that there is only one value for the parameter. If the parameter has (or could have) multiple values, servlet writers should use getParameterValues. If a multiple valued parameter name is passed as an argument, the return value is implementation dependent.

Parameters:
name the name of the parameter whose value is required.

Definition at line 410 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getParameter(), com.quadcap.http.server22.HttpRequest.maybeParsePostData(), and com.quadcap.http.server22.HttpRequest.parameters.

Referenced by com.quadcap.http.server22.HttpRequest.getParameter().

Enumeration com.quadcap.http.server22.HttpRequest.getParameterNames  ) 
 

Returns the parameter names for this request as an enumeration of strings, or an empty enumeration if there are no parameters or the input stream is empty.

The input stream would be empty if all the data had been read from the stream returned by the method getInputStream.

Definition at line 439 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.maybeParsePostData(), and com.quadcap.http.server22.HttpRequest.parameters.

String [] com.quadcap.http.server22.HttpRequest.getParameterValues String  name  ) 
 

Returns the values of the specified parameter for the request as an array of strings, or null if the named parameter does not exist.

For example, in an HTTP servlet this method would return the values of the specified query string or posted form as an array of strings.

Parameters:
name the name of the parameter whose value is required.

Definition at line 426 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getParameterValues(), com.quadcap.http.server22.HttpRequest.maybeParsePostData(), and com.quadcap.http.server22.HttpRequest.parameters.

Referenced by com.quadcap.http.server22.HttpRequest.getParameterValues().

String com.quadcap.http.server22.HttpRequest.getPathInfo  ) 
 

Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string.

Same as the CGI variable PATH_INFO.

Returns:
the optional path information following the servlet path, but before the query string, in this request's URI; null if this request's URI contains no extra path information

Definition at line 605 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getPathInfo(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.WebWorker.showException().

String com.quadcap.http.server22.HttpRequest.getPathTranslated  ) 
 

Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string, and translates it to a real path.

Similar to the CGI variable PATH_TRANSLATED

Returns:
extra path information translated to a real path or null if no extra path information is in the request's URI

Definition at line 618 of file HttpRequest.java.

String com.quadcap.http.server22.HttpRequest.getProtocol  ) 
 

Returns the protocol and version of the request as a string of the form <protocol>/<major version>.<minor version&gt.

Same as the CGI variable SERVER_PROTOCOL.

Definition at line 317 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.protocol.

Referenced by com.quadcap.http.server22.WebWorker.doSession().

String com.quadcap.http.server22.HttpRequest.getQueryString  ) 
 

Gets any query string that is part of the HTTP request URI.

Same as the CGI variable QUERY_STRING.

Returns:
query string that is part of this request's URI, or null if it contains no query string

Definition at line 629 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.headers, com.quadcap.http.server22.HttpRequest.queryString, com.quadcap.http.server22.HttpRequest.queryStringLen, and com.quadcap.http.server22.HttpRequest.queryStringStart.

Referenced by com.quadcap.http.server22.WebWorker.doSession().

BufferedReader com.quadcap.http.server22.HttpRequest.getReader  )  throws IOException
 

Returns a buffered reader for reading text in the request body.

This translates character set encodings as appropriate.

Exceptions:
UnsupportedEncodingException if the character set encoding is unsupported, so the text can't be correctly decoded.
IllegalStateException if getInputStream has been called on this same request.
IOException on other I/O related errors.

Definition at line 493 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getInputStream(), com.quadcap.http.server22.HttpRequest.getInputStreamCalled, com.quadcap.http.server22.HttpRequest.getReaderCalled, and com.quadcap.http.server22.HttpRequest.reader.

String com.quadcap.http.server22.HttpRequest.getRealPath String  path  ) 
 

Applies alias rules to the specified virtual path and returns the corresponding real path, or null if the translation can not be performed for any reason.

For example, an HTTP servlet would resolve the path using the virtual docroot, if virtual hosting is enabled, and with the default docroot otherwise. Calling this method with the string "/" as an argument returns the document root.

Parameters:
path the virtual path to be translated to a real path

Definition at line 375 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getContext(), com.quadcap.http.server22.WebApplication.getRealPath(), com.quadcap.http.server22.HttpRequest.getRealPath(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.HttpRequest.getRealPath().

String com.quadcap.http.server22.HttpRequest.getRemoteAddr  ) 
 

Returns the IP address of the agent that sent the request.

Same as the CGI variable REMOTE_ADDR.

Definition at line 352 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.w.

String com.quadcap.http.server22.HttpRequest.getRemoteHost  ) 
 

Returns the fully qualified host name of the agent that sent the request.

Same as the CGI variable REMOTE_HOST.

Definition at line 360 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.w.

String com.quadcap.http.server22.HttpRequest.getRemoteUser  ) 
 

Gets the name of the user making this request.

The user name is set with HTTP authentication. Whether the user name will continue to be sent with each subsequent communication is browser-dependent. Same as the CGI variable REMOTE_USER.

Returns:
the name of the user making this request, or null if not known.

Definition at line 648 of file HttpRequest.java.

RequestDispatcher com.quadcap.http.server22.HttpRequest.getRequestDispatcher String  path  ) 
 

Definition at line 1116 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getContext(), com.quadcap.http.server22.WebApplication.getRelativeRequestDispatcher(), com.quadcap.http.server22.HttpRequest.getRequestDispatcher(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.HttpRequest.getRequestDispatcher().

String com.quadcap.http.server22.HttpRequest.getRequestedSessionId  ) 
 

Gets the session id specified with this request.

This may differ from the actual session id. For example, if the request specified an id for an invalid session, then this will get a new session with a new id.

Returns:
the session id specified by this request, or null if the request did not specify a session id

Definition at line 835 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.cookies, com.quadcap.http.server22.WebApplication.createSession(), com.quadcap.http.server22.HttpDispatcher.getContext(), com.quadcap.http.server22.HttpRequest.getCookies(), com.quadcap.http.server22.HSession.getId(), com.quadcap.http.server22.WebApplication.getSession(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.HttpRequest.getSession(), and com.quadcap.http.server22.HttpRequest.isRequestedSessionIdValid().

String com.quadcap.http.server22.HttpRequest.getRequestURI  ) 
 

Gets, from the first line of the HTTP request, the part of this request's URI that is to the left of any query string.

For example,

<blockquote>
First line of HTTP requestReturn from getRequestURI
POST /some/path.html HTTP/1.1/some/path.html
GET http://foo.bar/a.html HTTP/1.0 http://foo.bar/a.html
HEAD /xyz?a=b HTTP/1.1/xyz

To reconstruct a URL with a URL scheme and host, use the method javax.servlet.http.HttpUtils.getRequestURL, which returns a StringBuffer.

Returns:
this request's URI

Definition at line 581 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.uri.

Referenced by com.quadcap.http.server22.WebWorker.doSession().

String com.quadcap.http.server22.HttpRequest.getScheme  ) 
 

Returns the scheme of the URL used in this request, for example "http", "https", or "ftp".

Different schemes have different rules for constructing URLs, as noted in RFC 1738. The URL used to create a request may be reconstructed using this scheme, the server name and port, and additional information such as URIs.

Definition at line 328 of file HttpRequest.java.

String com.quadcap.http.server22.HttpRequest.getServerName  ) 
 

Returns the host name of the server that received the request.

Same as the CGI variable SERVER_NAME.

Definition at line 336 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.w.

int com.quadcap.http.server22.HttpRequest.getServerPort  ) 
 

Returns the port number on which this request was received.

Same as the CGI variable SERVER_PORT.

Definition at line 344 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.w.

String com.quadcap.http.server22.HttpRequest.getServletPath  ) 
 

Gets the part of this request's URI that refers to the servlet being invoked.

Analogous to the CGI variable SCRIPT_NAME.

Returns:
the servlet being invoked, as contained in this request's URI

Definition at line 592 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getServletPath(), and com.quadcap.http.server22.HttpRequest.rd.

Referenced by com.quadcap.http.server22.WebApplication.getRelativeRequestDispatcher(), and com.quadcap.http.server22.WebWorker.showException().

HttpSession com.quadcap.http.server22.HttpRequest.getSession  ) 
 

Gets the current valid session associated with this request, and if necessary, creates a new session for the request.

Returns:
the session associated with this request.

Definition at line 821 of file HttpRequest.java.

HttpSession com.quadcap.http.server22.HttpRequest.getSession boolean  create  ) 
 

Gets the current valid session associated with this request, if create is false or, if necessary, creates a new session for the request, if create is true.

Note: to ensure the session is properly maintained, the servlet developer must call this method (at least once) before any output is written to the response.

Additionally, application-writers need to be aware that newly created sessions (that is, sessions for which HttpSession.isNew returns true) do not have any application-specific state.

Returns:
the session associated with this request or null if create was false and no valid session is associated with this request.

Definition at line 795 of file HttpRequest.java.

References com.quadcap.http.server22.HttpResponse.addCookie(), com.quadcap.http.server22.WebApplication.createSession(), com.quadcap.http.server22.HttpDispatcher.getContext(), com.quadcap.http.server22.HttpRequest.getContextPath(), com.quadcap.http.server22.HSession.getId(), com.quadcap.http.server22.HttpRequest.getRequestedSessionId(), com.quadcap.http.server22.WebApplication.getSession(), com.quadcap.http.server22.HttpRequest.rd, com.quadcap.http.server22.HttpRequest.res, com.quadcap.http.server22.HttpRequest.session, and com.quadcap.http.server22.HSession.updateLastAccess().

String com.quadcap.http.server22.HttpRequest.getToken OctetMap  map  )  throws IOException [package]
 

Parsing helper: Get the next bytes all of which are in the specified map.

Parameters:
map the octet map specifying the bytes we want

Definition at line 917 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getToken(), and com.quadcap.http.server22.HttpRequest.scanner.

Referenced by com.quadcap.http.server22.HttpRequest.getToken().

Principal com.quadcap.http.server22.HttpRequest.getUserPrincipal  ) 
 

Return a Principal object indicating the identity of the user associated with this request.

Definition at line 1029 of file HttpRequest.java.

boolean com.quadcap.http.server22.HttpRequest.isRequestedSessionIdFromCookie  ) 
 

Checks whether the session id specified by this request came in as a cookie.

(The requested session may not be one returned by the getSession method.)

Returns:
true if the session id specified by this request came in as a cookie; false otherwise

Definition at line 886 of file HttpRequest.java.

boolean com.quadcap.http.server22.HttpRequest.isRequestedSessionIdFromUrl  ) 
 

Definition at line 902 of file HttpRequest.java.

boolean com.quadcap.http.server22.HttpRequest.isRequestedSessionIdFromURL  ) 
 

Checks whether the session id specified by this request came in as part of the URL.

(The requested session may not be the one returned by the getSession method.)

Returns:
true if the session id specified by the request for this session came in as part of the URL; false otherwise

Definition at line 899 of file HttpRequest.java.

boolean com.quadcap.http.server22.HttpRequest.isRequestedSessionIdValid  ) 
 

Checks whether this request is associated with a session that is valid in the current session context.

If it is not valid, the requested session will never be returned from the getSession method.

Returns:
true if this request is assocated with a session that is valid in the current session context.

Definition at line 868 of file HttpRequest.java.

References com.quadcap.http.server22.HttpDispatcher.getContext(), com.quadcap.http.server22.HttpRequest.getRequestedSessionId(), com.quadcap.http.server22.WebApplication.getSession(), com.quadcap.http.server22.HSession.isValid(), and com.quadcap.http.server22.HttpRequest.rd.

boolean com.quadcap.http.server22.HttpRequest.isSecure  ) 
 

Definition at line 1120 of file HttpRequest.java.

boolean com.quadcap.http.server22.HttpRequest.isUserInRole String  role  ) 
 

Returns a boolean indicating whether the authenticated user is included in the indicated 'role'.

Definition at line 1021 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.isUserInRole().

Referenced by com.quadcap.http.server22.HttpRequest.isUserInRole().

final Locale com.quadcap.http.server22.HttpRequest.makeLocale String  s  )  [package]
 

Definition at line 1053 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.makeLocale().

Referenced by com.quadcap.http.server22.HttpRequest.getLocale(), and com.quadcap.http.server22.HttpRequest.makeLocale().

final void com.quadcap.http.server22.HttpRequest.maybeParsePostData  )  [package]
 

Definition at line 255 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.getContentType(), com.quadcap.http.server22.HttpRequest.getInputStreamCalled, com.quadcap.http.server22.HttpRequest.getReaderCalled, com.quadcap.http.server22.HttpRequest.his, com.quadcap.http.server22.HttpRequest.method, com.quadcap.http.server22.HttpRequest.methodPOST, com.quadcap.http.server22.HttpRequest.parameters, com.quadcap.http.server22.HttpRequest.parseParameters(), and com.quadcap.http.server22.HttpRequest.scanner.

Referenced by com.quadcap.http.server22.HttpRequest.getParameter(), com.quadcap.http.server22.HttpRequest.getParameterNames(), and com.quadcap.http.server22.HttpRequest.getParameterValues().

String com.quadcap.http.server22.HttpRequest.parseHttpVersion  )  throws IOException [package]
 

Parse the http version field from the request line.

Returns:
the http protocol and version
Exceptions:
IOException if the version field is incorrect

Definition at line 931 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.scanner, and com.quadcap.http.server22.HttpRequest.versionMap.

void com.quadcap.http.server22.HttpRequest.parseParameters Hashtable  params,
Scanner  s
[static]
 

Definition at line 977 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.mapE, and com.quadcap.http.server22.HttpRequest.mapM.

void com.quadcap.http.server22.HttpRequest.parseParameters Hashtable  params,
InputStream  is
[static]
 

Parse a set of parameters from the specified input stream.

Parameters:
is the input stream
Returns:
a table containing the parameters as String -> String[] entries.

Definition at line 973 of file HttpRequest.java.

References com.quadcap.http.server22.HttpRequest.parseParameters().

Referenced by com.quadcap.http.server22.HttpRequest.maybeParsePostData(), com.quadcap.http.server22.HttpRequest.parseParameters(), com.quadcap.http.server22.HttpRequest.reset(), and com.quadcap.http.server22.HttpRequest.setURI().