|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.catalina.connector.RequestBase
org.apache.catalina.connector.HttpRequestBase
Convenience base implementation of the HttpRequest interface, which can be used for the Request implementation required by most Connectors that implement the HTTP protocol. Only the connector-specific methods need to be implemented.
| Nested Class Summary | |
protected class |
HttpRequestBase.PrivilegedGetSession
Deprecated. |
| Field Summary | |
protected java.lang.String |
authType
Deprecated. The authentication type used for this request. |
protected java.lang.String |
contextPath
Deprecated. The context path for this request. |
protected java.util.ArrayList |
cookies
Deprecated. The set of cookies associated with this Request. |
protected java.lang.String |
decodedRequestURI
Deprecated. The decoded request URI associated with this request. |
protected static java.util.ArrayList |
empty
Deprecated. An empty collection to use for returning empty Enumerations. |
protected HttpRequestFacade |
facade
Deprecated. The facade associated with this request. |
protected java.text.SimpleDateFormat[] |
formats
Deprecated. The set of SimpleDateFormat formats to use in getDateHeader(). |
protected java.util.HashMap |
headers
Deprecated. The HTTP headers associated with this Request, keyed by name. |
protected static java.lang.String |
info
Deprecated. Descriptive information about this HttpRequest implementation. |
protected java.lang.String |
method
Deprecated. The request method associated with this Request. |
protected ParameterMap |
parameters
Deprecated. The parsed parameters for this request. |
protected boolean |
parsed
Deprecated. Have the parameters for this request been parsed yet? |
protected java.lang.String |
pathInfo
Deprecated. The path information for this request. |
protected java.lang.String |
queryString
Deprecated. The query string for this request. |
protected boolean |
requestedSessionCookie
Deprecated. Was the requested session ID received in a cookie? |
protected java.lang.String |
requestedSessionId
Deprecated. The requested session ID (if any) for this request. |
protected boolean |
requestedSessionURL
Deprecated. Was the requested session ID received in a URL? |
protected java.lang.String |
requestURI
Deprecated. The request URI associated with this request. |
protected boolean |
secure
Deprecated. Was this request received on a secure channel? |
protected java.lang.String |
servletPath
Deprecated. The servlet path for this request. |
protected Session |
session
Deprecated. The currently active session for this request. |
protected java.security.Principal |
userPrincipal
Deprecated. The Principal who has been authenticated for this Request. |
| Fields inherited from class org.apache.catalina.connector.RequestBase |
attributes, authorization, characterEncoding, connector, contentLength, contentType, context, defaultLocale, input, locales, protocol, reader, remoteAddr, remoteHost, response, scheme, serverName, serverPort, sm, socket, stream, wrapper |
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
HttpRequestBase()
Deprecated. |
|
| Method Summary | |
void |
addCookie(javax.servlet.http.Cookie cookie)
Deprecated. Add a Cookie to the set of Cookies associated with this Request. |
void |
addHeader(java.lang.String name,
java.lang.String value)
Deprecated. Add a Header to the set of Headers associated with this Request. |
void |
addParameter(java.lang.String name,
java.lang.String[] values)
Deprecated. Add a parameter name and corresponding set of values to this Request. |
void |
clearCookies()
Deprecated. Clear the collection of Cookies associated with this Request. |
void |
clearHeaders()
Deprecated. Clear the collection of Headers associated with this Request. |
void |
clearLocales()
Deprecated. Clear the collection of Locales associated with this Request. |
void |
clearParameters()
Deprecated. Clear the collection of parameters associated with this Request. |
java.lang.String |
getAuthType()
Deprecated. Return the authentication type used for this Request. |
java.lang.String |
getContextPath()
Deprecated. Return the portion of the request URI used to select the Context of the Request. |
javax.servlet.http.Cookie[] |
getCookies()
Deprecated. Return the set of Cookies received with this Request. |
long |
getDateHeader(java.lang.String name)
Deprecated. Return the value of the specified date header, if any; otherwise return -1. |
java.lang.String |
getDecodedRequestURI()
Deprecated. Return the URL decoded request URI. |
java.lang.String |
getHeader(java.lang.String name)
Deprecated. Return the first value of the specified header, if any; otherwise, return null |
java.util.Enumeration |
getHeaderNames()
Deprecated. Return the names of all headers received with this request. |
java.util.Enumeration |
getHeaders(java.lang.String name)
Deprecated. Return all of the values of the specified header, if any; otherwise, return an empty enumeration. |
java.lang.String |
getInfo()
Deprecated. Return descriptive information about this Request implementation and the corresponding version number, in the format <description>/<version>. |
int |
getIntHeader(java.lang.String name)
Deprecated. Return the value of the specified header as an integer, or -1 if there is no such header for this request. |
java.lang.String |
getMethod()
Deprecated. Return the HTTP request method used in this Request. |
java.lang.String |
getParameter(java.lang.String name)
Deprecated. Return the value of the specified request parameter, if any; otherwise, return null. |
java.util.Map |
getParameterMap()
Deprecated. Returns a Map of the parameters of this request.
|
java.util.Enumeration |
getParameterNames()
Deprecated. Return the names of all defined request parameters for this request. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Deprecated. Return the defined values for the specified request parameter, if any; otherwise, return null. |
java.lang.String |
getPathInfo()
Deprecated. Return the path information associated with this Request. |
java.lang.String |
getPathTranslated()
Deprecated. Return the extra path information for this request, translated to a real path. |
java.lang.String |
getQueryString()
Deprecated. Return the query string associated with this request. |
java.lang.String |
getRemoteUser()
Deprecated. Return the name of the remote user that has been authenticated for this Request. |
javax.servlet.ServletRequest |
getRequest()
Deprecated. Return the ServletRequest for which this object
is the facade. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Deprecated. Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path. |
java.lang.String |
getRequestedSessionId()
Deprecated. Return the session identifier included in this request, if any. |
java.lang.String |
getRequestURI()
Deprecated. Return the request URI for this request. |
java.lang.StringBuffer |
getRequestURL()
Deprecated. Reconstructs the URL the client used to make the request. |
java.lang.String |
getServletPath()
Deprecated. Return the portion of the request URI used to select the servlet that will process this request. |
javax.servlet.http.HttpSession |
getSession()
Deprecated. Return the session associated with this Request, creating one if necessary. |
javax.servlet.http.HttpSession |
getSession(boolean create)
Deprecated. Return the session associated with this Request, creating one if necessary and requested. |
java.security.Principal |
getUserPrincipal()
Deprecated. Return the principal that has been authenticated for this Request. |
boolean |
isRequestedSessionIdFromCookie()
Deprecated. Return true if the session identifier included in this
request came from a cookie. |
boolean |
isRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead. |
boolean |
isRequestedSessionIdFromURL()
Deprecated. Return true if the session identifier included in this
request came from the request URI. |
boolean |
isRequestedSessionIdValid()
Deprecated. Return true if the session identifier included in this
request identifies a valid session. |
boolean |
isSecure()
Deprecated. Was this request received on a secure connection? |
boolean |
isUserInRole(java.lang.String role)
Deprecated. Return true if the authenticated user principal
possesses the specified role name. |
protected void |
parseParameters()
Deprecated. Parse the parameters of this request, if it has not already occurred. |
void |
recycle()
Deprecated. Release all object references, and initialize instance variables, in preparation for reuse of this object. |
void |
setAuthType(java.lang.String authType)
Deprecated. Set the authentication type used for this request, if any; otherwise set the type to null. |
void |
setContextPath(java.lang.String path)
Deprecated. Set the context path for this Request. |
void |
setDecodedRequestURI(java.lang.String uri)
Deprecated. Set the decoded request URI. |
void |
setMethod(java.lang.String method)
Deprecated. Set the HTTP request method used for this Request. |
void |
setPathInfo(java.lang.String path)
Deprecated. Set the path information for this Request. |
void |
setQueryString(java.lang.String query)
Deprecated. Set the query string for this Request. |
void |
setRequestedSessionCookie(boolean flag)
Deprecated. Set a flag indicating whether or not the requested session ID for this request came in through a cookie. |
void |
setRequestedSessionId(java.lang.String id)
Deprecated. Set the requested session ID for this request. |
void |
setRequestedSessionURL(boolean flag)
Deprecated. Set a flag indicating whether or not the requested session ID for this request came in through a URL. |
void |
setRequestURI(java.lang.String uri)
Deprecated. Set the unparsed request URI for this Request. |
void |
setSecure(boolean secure)
Deprecated. Set the flag indicating whether this Request was received on a secure communications link or not. |
void |
setServletPath(java.lang.String path)
Deprecated. Set the servlet path for this Request. |
void |
setUserPrincipal(java.security.Principal principal)
Deprecated. Set the Principal who has been authenticated for this Request. |
| Methods inherited from class org.apache.catalina.connector.RequestBase |
addLocale, createInputStream, finishRequest, getAttribute, getAttributeNames, getAuthorization, getCharacterEncoding, getConnector, getContentLength, getContentType, getContext, getInputStream, getLocale, getLocales, getNote, getNoteNames, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getResponse, getScheme, getServerName, getServerPort, getSocket, getStream, getWrapper, removeAttribute, removeNote, setAttribute, setAuthorization, setCharacterEncoding, setConnector, setContentLength, setContentType, setContext, setNote, setProtocol, setRemoteAddr, setRemoteHost, setResponse, setScheme, setServerName, setServerPort, setSocket, setStream, setWrapper |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.catalina.HttpRequest |
addLocale |
| Methods inherited from interface org.apache.catalina.Request |
createInputStream, finishRequest, getAuthorization, getConnector, getContext, getNote, getNoteNames, getResponse, getSocket, getStream, getWrapper, removeNote, setAuthorization, setConnector, setContentLength, setContentType, setContext, setNote, setProtocol, setRemoteAddr, setResponse, setScheme, setServerName, setServerPort, setSocket, setStream, setWrapper |
| Methods inherited from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding |
| Field Detail |
protected java.lang.String authType
protected java.lang.String contextPath
protected java.util.ArrayList cookies
protected static java.util.ArrayList empty
protected java.text.SimpleDateFormat[] formats
protected HttpRequestFacade facade
protected java.util.HashMap headers
protected static final java.lang.String info
protected java.lang.String method
protected ParameterMap parameters
getParameter() family of method calls. The key is the
parameter name, while the value is a String array of values for this
parameter.
IMPLEMENTATION NOTE - Once the parameters for a particular request are parsed and stored here, they are not modified. Therefore, application level access to the parameters need not be synchronized.
protected boolean parsed
protected java.lang.String pathInfo
protected java.lang.String queryString
protected boolean requestedSessionCookie
protected java.lang.String requestedSessionId
protected boolean requestedSessionURL
protected java.lang.String requestURI
protected java.lang.String decodedRequestURI
protected boolean secure
protected java.lang.String servletPath
protected Session session
protected java.security.Principal userPrincipal
| Constructor Detail |
public HttpRequestBase()
| Method Detail |
public java.lang.String getInfo()
<description>/<version>.
getInfo in interface RequestgetInfo in class RequestBasepublic javax.servlet.ServletRequest getRequest()
ServletRequest for which this object
is the facade. This method must be implemented by a subclass.
getRequest in interface RequestgetRequest in class RequestBasepublic void addCookie(javax.servlet.http.Cookie cookie)
addCookie in interface HttpRequestcookie - The new cookie
public void addHeader(java.lang.String name,
java.lang.String value)
addHeader in interface HttpRequestname - The new header namevalue - The new header value
public void addParameter(java.lang.String name,
java.lang.String[] values)
addParameter in interface HttpRequestname - Name of this request parametervalues - Corresponding values for this request parameterpublic void clearCookies()
clearCookies in interface HttpRequestpublic void clearHeaders()
clearHeaders in interface HttpRequestpublic void clearLocales()
clearLocales in interface HttpRequestpublic void clearParameters()
clearParameters in interface HttpRequestpublic void recycle()
recycle in interface Requestrecycle in class RequestBasepublic void setAuthType(java.lang.String authType)
null. Typical values are "BASIC",
"DIGEST", or "SSL".
setAuthType in interface HttpRequestauthType - The authentication type usedpublic void setContextPath(java.lang.String path)
setContextPath in interface HttpRequestpath - The context pathpublic void setMethod(java.lang.String method)
setMethod in interface HttpRequestmethod - The request methodpublic void setPathInfo(java.lang.String path)
setPathInfo in interface HttpRequestpath - The path informationpublic void setQueryString(java.lang.String query)
setQueryString in interface HttpRequestquery - The query stringpublic void setRequestedSessionCookie(boolean flag)
setRequestedSessionCookie in interface HttpRequestflag - The new flagpublic void setRequestedSessionId(java.lang.String id)
setRequestedSessionId in interface HttpRequestid - The new session idpublic void setRequestedSessionURL(boolean flag)
setRequestedSessionURL in interface HttpRequestflag - The new flagpublic void setRequestURI(java.lang.String uri)
setRequestURI in interface HttpRequesturi - The request URIpublic void setSecure(boolean secure)
setSecure in interface RequestsetSecure in class RequestBasesecure - The new secure flagpublic void setServletPath(java.lang.String path)
setServletPath in interface HttpRequestpath - The servlet pathpublic void setUserPrincipal(java.security.Principal principal)
getRemoteUser() method.
setUserPrincipal in interface HttpRequestprincipal - The user Principalprotected void parseParameters()
public java.lang.String getParameter(java.lang.String name)
null. If there is more than one value defined,
return only the first one.
getParameter in interface javax.servlet.ServletRequestgetParameter in class RequestBasename - Name of the desired request parameterpublic java.util.Map getParameterMap()
Map of the parameters of this request.
Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string
or posted form data.
getParameterMap in interface javax.servlet.ServletRequestgetParameterMap in class RequestBaseMap containing parameter names as keys
and parameter values as map values.public java.util.Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestgetParameterNames in class RequestBasepublic java.lang.String[] getParameterValues(java.lang.String name)
null.
getParameterValues in interface javax.servlet.ServletRequestgetParameterValues in class RequestBasename - Name of the desired request parameterpublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher in interface javax.servlet.ServletRequestgetRequestDispatcher in class RequestBasepath - Path of the resource to be wrappedpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestisSecure in class RequestBasepublic java.lang.String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic long getDateHeader(java.lang.String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestname - Name of the requested date header
java.lang.IllegalArgumentException - if the specified header value
cannot be converted to a datepublic java.lang.String getHeader(java.lang.String name)
null
getHeader in interface javax.servlet.http.HttpServletRequestname - Name of the requested headerpublic java.util.Enumeration getHeaders(java.lang.String name)
getHeaders in interface javax.servlet.http.HttpServletRequestname - Name of the requested headerpublic java.util.Enumeration getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(java.lang.String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestname - Name of the requested header
java.lang.IllegalArgumentException - if the specified header value
cannot be converted to an integerpublic java.lang.String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic void setDecodedRequestURI(java.lang.String uri)
setDecodedRequestURI in interface HttpRequesturi - The decoded request URIpublic java.lang.String getDecodedRequestURI()
getDecodedRequestURI in interface HttpRequestpublic java.lang.StringBuffer getRequestURL()
Because this method returns a StringBuffer,
not a String, you can modify the URL easily,
for example, to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
getRequestURL in interface javax.servlet.http.HttpServletRequestStringBuffer object containing the
reconstructed URLpublic java.lang.String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestcreate - Create a new session if one does not existpublic boolean isRequestedSessionIdFromCookie()
true if the session identifier included in this
request came from a cookie.
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
true if the session identifier included in this
request came from the request URI.
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromURL() instead.
true if the session identifier included in this
request came from the request URI.
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdValid()
true if the session identifier included in this
request identifies a valid session.
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(java.lang.String role)
true if the authenticated user principal
possesses the specified role name.
isUserInRole in interface javax.servlet.http.HttpServletRequestrole - Role name to be validatedpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||