|
||||||||||
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 Request
getInfo
in class RequestBase
public javax.servlet.ServletRequest getRequest()
ServletRequest
for which this object
is the facade. This method must be implemented by a subclass.
getRequest
in interface Request
getRequest
in class RequestBase
public void addCookie(javax.servlet.http.Cookie cookie)
addCookie
in interface HttpRequest
cookie
- The new cookiepublic void addHeader(java.lang.String name, java.lang.String value)
addHeader
in interface HttpRequest
name
- The new header namevalue
- The new header valuepublic void addParameter(java.lang.String name, java.lang.String[] values)
addParameter
in interface HttpRequest
name
- Name of this request parametervalues
- Corresponding values for this request parameterpublic void clearCookies()
clearCookies
in interface HttpRequest
public void clearHeaders()
clearHeaders
in interface HttpRequest
public void clearLocales()
clearLocales
in interface HttpRequest
public void clearParameters()
clearParameters
in interface HttpRequest
public void recycle()
recycle
in interface Request
recycle
in class RequestBase
public void setAuthType(java.lang.String authType)
null
. Typical values are "BASIC",
"DIGEST", or "SSL".
setAuthType
in interface HttpRequest
authType
- The authentication type usedpublic void setContextPath(java.lang.String path)
setContextPath
in interface HttpRequest
path
- The context pathpublic void setMethod(java.lang.String method)
setMethod
in interface HttpRequest
method
- The request methodpublic void setPathInfo(java.lang.String path)
setPathInfo
in interface HttpRequest
path
- The path informationpublic void setQueryString(java.lang.String query)
setQueryString
in interface HttpRequest
query
- The query stringpublic void setRequestedSessionCookie(boolean flag)
setRequestedSessionCookie
in interface HttpRequest
flag
- The new flagpublic void setRequestedSessionId(java.lang.String id)
setRequestedSessionId
in interface HttpRequest
id
- The new session idpublic void setRequestedSessionURL(boolean flag)
setRequestedSessionURL
in interface HttpRequest
flag
- The new flagpublic void setRequestURI(java.lang.String uri)
setRequestURI
in interface HttpRequest
uri
- The request URIpublic void setSecure(boolean secure)
setSecure
in interface Request
setSecure
in class RequestBase
secure
- The new secure flagpublic void setServletPath(java.lang.String path)
setServletPath
in interface HttpRequest
path
- The servlet pathpublic void setUserPrincipal(java.security.Principal principal)
getRemoteUser()
method.
setUserPrincipal
in interface HttpRequest
principal
- 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.ServletRequest
getParameter
in class RequestBase
name
- 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.ServletRequest
getParameterMap
in class RequestBase
Map
containing parameter names as keys
and parameter values as map values.public java.util.Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class RequestBase
public java.lang.String[] getParameterValues(java.lang.String name)
null
.
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class RequestBase
name
- Name of the desired request parameterpublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher
in interface javax.servlet.ServletRequest
getRequestDispatcher
in class RequestBase
path
- Path of the resource to be wrappedpublic boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
isSecure
in class RequestBase
public java.lang.String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public long getDateHeader(java.lang.String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
name
- 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.HttpServletRequest
name
- Name of the requested headerpublic java.util.Enumeration getHeaders(java.lang.String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
name
- Name of the requested headerpublic java.util.Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(java.lang.String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
name
- 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.HttpServletRequest
public java.lang.String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public java.lang.String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public void setDecodedRequestURI(java.lang.String uri)
setDecodedRequestURI
in interface HttpRequest
uri
- The decoded request URIpublic java.lang.String getDecodedRequestURI()
getDecodedRequestURI
in interface HttpRequest
public 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.HttpServletRequest
StringBuffer
object containing the
reconstructed URLpublic java.lang.String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean create)
getSession
in interface javax.servlet.http.HttpServletRequest
create
- 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.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
true
if the session identifier included in this
request came from the request URI.
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromURL()
instead.
true
if the session identifier included in this
request came from the request URI.
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
true
if the session identifier included in this
request identifies a valid session.
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(java.lang.String role)
true
if the authenticated user principal
possesses the specified role name.
isUserInRole
in interface javax.servlet.http.HttpServletRequest
role
- 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 |