|
|||||||||
| Home >> All >> com >> prolifics >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.prolifics.servlet
Class FilterHttpServletRequest

java.lang.Objectcom.prolifics.servlet.FilterHttpServletRequest
- All Implemented Interfaces:
- javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest
- public class FilterHttpServletRequest
- extends java.lang.Object
- implements javax.servlet.http.HttpServletRequest
- extends java.lang.Object
An HTTP servlet request. This interface gets data from the client
to the servlet for use in the HttpServlet.service
method. It allows the HTTP-protocol specified header information to
be accessed from the service method. This interface is
implemented by network-service developers for use within servlets.
- Version:
- @(#)FilterHttpServletRequest.java 77.1 99/04/22 15:03:04
| Field Summary | |
private javax.servlet.http.HttpServletRequest |
req
|
private static java.lang.String |
sccsid
|
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
FilterHttpServletRequest(javax.servlet.http.HttpServletRequest req)
|
|
| Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the named attribute of the request, or null if the attribute does not exist. |
java.util.Enumeration |
getAttributeNames()
Returns an enumeration of all the attribute names contained in the request. |
java.lang.String |
getAuthType()
Gets the authentication scheme of this request. |
java.lang.String |
getCharacterEncoding()
Returns the character set encoding for the input of this request. |
int |
getContentLength()
Returns the size of the request entity data, or -1 if not known. |
java.lang.String |
getContentType()
Returns the Internet Media Type of the request entity data, or null if not known. |
javax.servlet.http.Cookie[] |
getCookies()
Gets the array of cookies found in this request. |
long |
getDateHeader(java.lang.String name)
Gets the value of the requested date header field of this request. |
java.lang.String |
getHeader(java.lang.String name)
Gets the value of the requested header field of this request. |
java.util.Enumeration |
getHeaderNames()
Gets the header names for this request. |
javax.servlet.ServletInputStream |
getInputStream()
Returns an input stream for reading binary data in the request body. |
int |
getIntHeader(java.lang.String name)
Gets the value of the specified integer header field of this request. |
java.lang.String |
getMethod()
Gets the HTTP method (for example, GET, POST, PUT) with which this request was made. |
java.lang.String |
getParameter(java.lang.String name)
Returns a string containing the lone value of the specified parameter, or null if the parameter does not exist. |
java.util.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. |
java.lang.String[] |
getParameterValues(java.lang.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. |
java.lang.String |
getPathInfo()
Gets any optional extra path information following the servlet path of this request's URI, but immediately preceding its query string. |
java.lang.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. |
java.lang.String |
getProtocol()
Returns the protocol and version of the request as a string of the form <protocol>/<major version>.<minor
version>. |
java.lang.String |
getQueryString()
Gets any query string that is part of the HTTP request URI. |
java.io.BufferedReader |
getReader()
Returns a buffered reader for reading text in the request body. |
java.lang.String |
getRealPath(java.lang.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. |
java.lang.String |
getRemoteAddr()
Returns the IP address of the agent that sent the request. |
java.lang.String |
getRemoteHost()
Returns the fully qualified host name of the agent that sent the request. |
java.lang.String |
getRemoteUser()
Gets the name of the user making this request. |
java.lang.String |
getRequestedSessionId()
Gets the session id specified with this request. |
java.lang.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. |
java.lang.String |
getScheme()
Returns the scheme of the URL used in this request, for example "http", "https", or "ftp". |
java.lang.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. |
java.lang.String |
getServletPath()
Gets the part of this request's URI that refers to the servlet being invoked. |
javax.servlet.http.HttpSession |
getSession()
Gets the current valid session associated with this request, or, if necessary, creates a new session for the request. |
javax.servlet.http.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. |
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()
Checks whether the session id specified by this request came in as part of the URL. |
boolean |
isRequestedSessionIdValid()
Checks whether this request is associated with a session that is valid in the current session context. |
void |
setAttribute(java.lang.String name,
java.lang.Object object)
This method places an attribute into the request for later use by other objects which will have access to this request ojbect such as nested servlets. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.http.HttpServletRequest |
getContextPath, getHeaders, getRequestURL, getUserPrincipal, isUserInRole |
| Methods inherited from interface javax.servlet.ServletRequest |
getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getRemotePort, getRequestDispatcher, isSecure, removeAttribute, setCharacterEncoding |
| Field Detail |
sccsid
private static java.lang.String sccsid
req
private javax.servlet.http.HttpServletRequest req
| Constructor Detail |
FilterHttpServletRequest
public FilterHttpServletRequest(javax.servlet.http.HttpServletRequest req)
| Method Detail |
getCookies
public javax.servlet.http.Cookie[] getCookies()
- Gets the array of cookies found in this request.
- Specified by:
getCookiesin interfacejavax.servlet.http.HttpServletRequest
getMethod
public java.lang.String getMethod()
- Gets the HTTP method (for example, GET, POST, PUT) with which
this request was made. Same as the CGI variable REQUEST_METHOD.
- Specified by:
getMethodin interfacejavax.servlet.http.HttpServletRequest
getRequestURI
public java.lang.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.
For example,
First line of HTTP request Return from getRequestURIPOST /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.
- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest
getServletPath
public java.lang.String getServletPath()
- Gets the part of this request's URI that refers to the servlet
being invoked. Analogous to the CGI variable SCRIPT_NAME.
- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest
getPathInfo
public java.lang.String 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.
- Specified by:
getPathInfoin interfacejavax.servlet.http.HttpServletRequest
getPathTranslated
public java.lang.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. Similar to the CGI
variable PATH_TRANSLATED
- Specified by:
getPathTranslatedin interfacejavax.servlet.http.HttpServletRequest
getQueryString
public java.lang.String getQueryString()
- Gets any query string that is part of the HTTP request URI.
Same as the CGI variable QUERY_STRING.
- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest
getRemoteUser
public java.lang.String 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.
- Specified by:
getRemoteUserin interfacejavax.servlet.http.HttpServletRequest
getAuthType
public java.lang.String getAuthType()
- Gets the authentication scheme of this request. Same as the CGI
variable AUTH_TYPE.
- Specified by:
getAuthTypein interfacejavax.servlet.http.HttpServletRequest
getHeader
public java.lang.String getHeader(java.lang.String name)
- Gets the value of the requested header field of this request.
The case of the header field name is ignored.
- Specified by:
getHeaderin interfacejavax.servlet.http.HttpServletRequest
getIntHeader
public int getIntHeader(java.lang.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.
- Specified by:
getIntHeaderin interfacejavax.servlet.http.HttpServletRequest
getDateHeader
public long getDateHeader(java.lang.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.
- Specified by:
getDateHeaderin interfacejavax.servlet.http.HttpServletRequest
getHeaderNames
public java.util.Enumeration getHeaderNames()
- Gets the header names for this request.
- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletRequest
getSession
public javax.servlet.http.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.
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.isNewreturns true) do not have any application-specific state.- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
getSession
public javax.servlet.http.HttpSession getSession()
- Gets the current valid session associated with this request,
or, if necessary, creates a new session for the
request.
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.isNewreturns true) do not have any application-specific state.- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
getRequestedSessionId
public java.lang.String 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.
- Specified by:
getRequestedSessionIdin interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdValid
public boolean 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
getSessionmethod.- Specified by:
isRequestedSessionIdValidin interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdFromCookie
public boolean 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
getSessionmethod.)- Specified by:
isRequestedSessionIdFromCookiein interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdFromUrl
public boolean 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
getSessionmethod.)- Specified by:
isRequestedSessionIdFromUrlin interfacejavax.servlet.http.HttpServletRequest
isRequestedSessionIdFromURL
public boolean 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
getSessionmethod.)- Specified by:
isRequestedSessionIdFromURLin interfacejavax.servlet.http.HttpServletRequest
getContentLength
public int getContentLength()
- Returns the size of the request entity data, or -1 if not known.
Same as the CGI variable CONTENT_LENGTH.
- Specified by:
getContentLengthin interfacejavax.servlet.ServletRequest
getContentType
public java.lang.String getContentType()
- Returns the Internet Media Type of the request entity data, or
null if not known. Same as the CGI variable CONTENT_TYPE.
- Specified by:
getContentTypein interfacejavax.servlet.ServletRequest
getProtocol
public java.lang.String getProtocol()
- Returns the protocol and version of the request as a string of
the form
<protocol>/<major version>.<minor version>. Same as the CGI variable SERVER_PROTOCOL.- Specified by:
getProtocolin interfacejavax.servlet.ServletRequest
getScheme
public java.lang.String 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.
- Specified by:
getSchemein interfacejavax.servlet.ServletRequest
getServerName
public java.lang.String getServerName()
- Returns the host name of the server that received the request.
Same as the CGI variable SERVER_NAME.
- Specified by:
getServerNamein interfacejavax.servlet.ServletRequest
getServerPort
public int getServerPort()
- Returns the port number on which this request was received.
Same as the CGI variable SERVER_PORT.
- Specified by:
getServerPortin interfacejavax.servlet.ServletRequest
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object object)
- This method places an attribute into the request for later
use by other objects which will have access to this request
ojbect such as nested servlets.
- Specified by:
setAttributein interfacejavax.servlet.ServletRequest
getRemoteAddr
public java.lang.String getRemoteAddr()
- Returns the IP address of the agent that sent the request.
Same as the CGI variable REMOTE_ADDR.
- Specified by:
getRemoteAddrin interfacejavax.servlet.ServletRequest
getRemoteHost
public java.lang.String getRemoteHost()
- Returns the fully qualified host name of the agent that sent the
request. Same as the CGI variable REMOTE_HOST.
- Specified by:
getRemoteHostin interfacejavax.servlet.ServletRequest
getRealPath
public java.lang.String getRealPath(java.lang.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.
- Specified by:
getRealPathin interfacejavax.servlet.ServletRequest
getInputStream
public javax.servlet.ServletInputStream getInputStream() throws java.io.IOException
- Returns an input stream for reading binary data in the request body.
- Specified by:
getInputStreamin interfacejavax.servlet.ServletRequest
getParameter
public java.lang.String getParameter(java.lang.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.
- Specified by:
getParameterin interfacejavax.servlet.ServletRequest
getParameterValues
public java.lang.String[] getParameterValues(java.lang.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.
- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest
getParameterNames
public java.util.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. The input stream would be empty
if all the data had been read from the stream returned by the
method getInputStream.
- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Returns the value of the named attribute of the request, or
null if the attribute does not exist. This method allows
access to request information not already provided by the other
methods in this interface. Attribute names should follow the
same convention as package names.
The following predefined attributes are provided.
Attribute Name Attribute Type Description javax.net.ssl.cipher_suite string The string name of the SSL cipher suite in use, if the request was made using SSL javax.net.ssl.peer_certificates array of javax.security.cert.X509Certificate The chain of X.509 certificates which authenticates the client. This is only available when SSL is used with client authentication is used. javax.net.ssl.session javax.net.ssl.SSLSession An SSL session object, if the request was made using SSL.
The package (and hence attribute) names beginning with java.*, and javax.* are reserved for use by Javasoft. Similarly, com.sun.* is reserved for use by Sun Microsystems.
- Specified by:
getAttributein interfacejavax.servlet.ServletRequest
getAttributeNames
public java.util.Enumeration getAttributeNames()
- Returns an enumeration of all the attribute names contained
in the request.
- Specified by:
getAttributeNamesin interfacejavax.servlet.ServletRequest
getReader
public java.io.BufferedReader getReader() throws java.io.IOException
- Returns a buffered reader for reading text in the request body.
This translates character set encodings as appropriate.
- Specified by:
getReaderin interfacejavax.servlet.ServletRequest
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Returns the character set encoding for the input of this request.
- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletRequest
|
|||||||||
| Home >> All >> com >> prolifics >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.prolifics.servlet.FilterHttpServletRequest