![]() |
Quadcap Embeddable Server |
Inheritance diagram for com.quadcap.http.server22.HttpRequest:

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>. | |
| 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") |
|
|
Using the specified worker's input stream, read an HTTP request, and construct a new
Definition at line 137 of file HttpRequest.java. |
|
|
|
|
|
Definition at line 268 of file HttpRequest.java. |
|
||||||||||||
|
Definition at line 1083 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.compareAccept(). Referenced by com.quadcap.http.server22.HttpRequest.compareAccept(). |
|
|
Returns the value of the named attribute of the request, or null if the attribute does not exist.
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(). |
|
|
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. |
|
|
Gets the authentication scheme of this request. Same as the CGI variable AUTH_TYPE.
Definition at line 658 of file HttpRequest.java. |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
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(). |
|
|
Gets 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(). |
|
|
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.
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(). |
|
|
Gets the value of the requested header field of this request. The case of the header field name is ignored.
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(). |
|
|
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(). |
|
|
Definition at line 747 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.headers, and com.quadcap.http.server22.HttpRequest.hOffsets. |
|
|
Gets the header names for this request.
Definition at line 743 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.getHeaderNames(). Referenced by com.quadcap.http.server22.WebWorker.showException(). |
|
|
Returns an input stream for reading binary data in the request body.
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(). |
|
|
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.
Definition at line 700 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.getIntHeader(). Referenced by com.quadcap.http.server22.HttpRequest.getIntHeader(). |
|
|
Definition at line 1070 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.getLangQual(). Referenced by com.quadcap.http.server22.HttpRequest.getLangQual(). |
|
|
Return the preferred Locale that the client will accept content from based on the
Definition at line 1038 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.makeLocale(). |
|
|
Definition at line 1091 of file HttpRequest.java. |
|
|
Gets the HTTP method (for example, GET, POST, PUT) with which this request was made. Same as the CGI variable REQUEST_METHOD.
Definition at line 555 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.method. Referenced by com.quadcap.http.server22.WebWorker.doSession(). |
|
|
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.
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(). |
|
|
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. |
|
|
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.
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(). |
|
|
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.
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(). |
|
|
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
Definition at line 618 of file HttpRequest.java. |
|
|
Returns the protocol and version of the request as a string of the form 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(). |
|
|
Gets any query string that is part of the HTTP request URI. Same as the CGI variable 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(). |
|
|
Returns a buffered reader for reading text in the request body. This translates character set encodings as appropriate.
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. |
|
|
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.
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(). |
|
|
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. |
|
|
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. |
|
|
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.
Definition at line 648 of file HttpRequest.java. |
|
|
|
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.
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(). |
|
|
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>
To reconstruct a URL with a URL scheme and host, use the method javax.servlet.http.HttpUtils.getRequestURL, which returns a StringBuffer.
Definition at line 581 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.uri. Referenced by com.quadcap.http.server22.WebWorker.doSession(). |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
Gets the part of this request's URI that refers to the servlet being invoked. Analogous to the CGI variable SCRIPT_NAME.
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(). |
|
|
Gets the current valid session associated with this request, and if necessary, creates a new session for the request.
Definition at line 821 of file HttpRequest.java. |
|
|
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
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(). |
|
|
Parsing helper: Get the next bytes all of which are in the specified map.
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(). |
|
|
Return a Principal object indicating the identity of the user associated with this request.
Definition at line 1029 of file HttpRequest.java. |
|
|
Checks whether the session id specified by this request came in as a cookie.
(The requested session may not be one returned by the
Definition at line 886 of file HttpRequest.java. |
|
|
Definition at line 902 of file HttpRequest.java. |
|
|
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
Definition at line 899 of file HttpRequest.java. |
|
|
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
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. |
|
|
Definition at line 1120 of file HttpRequest.java. |
|
|
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(). |
|
|
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(). |
|
|
|
Parse the http version field from the request line.
Definition at line 931 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.scanner, and com.quadcap.http.server22.HttpRequest.versionMap. |
|
||||||||||||
|
Definition at line 977 of file HttpRequest.java. References com.quadcap.http.server22.HttpRequest.mapE, and com.quadcap.http.server22.HttpRequest.mapM. |
|
||||||||||||
|
Parse a set of parameters from the specified input stream.
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(). |