public class ApplicationHttpRequest
extends javax.servlet.http.HttpServletRequestWrapper
javax.servlet.http.HttpServletRequest
that transforms an application request object (which might be the original
one passed to a servlet, or might be based on the 2.3
javax.servlet.http.HttpServletRequestWrapper class)
back into an internal org.apache.catalina.HttpRequest.| Modifier and Type | Class and Description |
|---|---|
protected class |
ApplicationHttpRequest.AttributeNamesEnumerator
Utility class used to expose the special attributes as being available
as request attributes.
|
| Modifier and Type | Field and Description |
|---|---|
protected Context |
context
The context for this request.
|
protected String |
contextPath
The context path for this request.
|
protected boolean |
crossContext
If this request is cross context, since this changes session access
behavior.
|
protected javax.servlet.DispatcherType |
dispatcherType
The dispatcher type.
|
protected Map<String,String[]> |
parameters
The request parameters for this request.
|
protected String |
pathInfo
The path information for this request.
|
protected String |
queryString
The query string for this request.
|
protected Object |
requestDispatcherPath
The current request dispatcher path.
|
protected String |
requestURI
The request URI for this request.
|
protected String |
servletPath
The servlet path for this request.
|
protected Session |
session
The currently active session for this request.
|
| Constructor and Description |
|---|
ApplicationHttpRequest(javax.servlet.http.HttpServletRequest request,
Context context,
boolean crossContext,
javax.servlet.http.HttpServletMapping mappingForDispatch,
javax.servlet.DispatcherType dispatcherType)
Construct a new wrapped request around the specified servlet request.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name)
Override the
getAttribute() method of the wrapped request. |
Enumeration<String> |
getAttributeNames()
Override the
getAttributeNames() method of the wrapped
request. |
String |
getContextPath()
Override the
getContextPath() method of the wrapped
request. |
javax.servlet.DispatcherType |
getDispatcherType() |
javax.servlet.http.HttpServletMapping |
getHttpServletMapping() |
String |
getParameter(String name)
Override the
getParameter() method of the wrapped request. |
Map<String,String[]> |
getParameterMap()
Override the
getParameterMap() method of the
wrapped request. |
Enumeration<String> |
getParameterNames()
Override the
getParameterNames() method of the
wrapped request. |
String[] |
getParameterValues(String name)
Override the
getParameterValues() method of the
wrapped request. |
String |
getPathInfo()
Override the
getPathInfo() method of the wrapped request. |
String |
getQueryString()
Override the
getQueryString() method of the wrapped
request. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
Return a RequestDispatcher that wraps the resource at the specified
path, which may be interpreted as relative to the current request path.
|
RequestFacade |
getRequestFacade()
Gets the facade for the request implementation object.
|
String |
getRequestURI()
Override the
getRequestURI() method of the wrapped
request. |
StringBuffer |
getRequestURL()
Override the
getRequestURL() method of the wrapped
request. |
String |
getServletPath()
Override the
getServletPath() method of the wrapped
request. |
javax.servlet.http.HttpSession |
getSession()
Return the session associated with this Request, creating one
if necessary.
|
javax.servlet.http.HttpSession |
getSession(boolean create)
Return the session associated with this Request, creating one
if necessary and requested.
|
boolean |
isRequestedSessionIdValid()
Returns true if the request specifies a JSESSIONID that is valid within
the context of this ApplicationHttpRequest, false otherwise.
|
protected boolean |
isSpecial(String name)
Is this attribute name one of the special ones that is added only for
included servlets?
|
protected String[] |
mergeValues(Object values1,
Object values2)
Merge the two sets of parameter values into a single String array.
|
javax.servlet.http.PushBuilder |
newPushBuilder() |
void |
recycle()
Recycle this request
|
void |
removeAttribute(String name)
Override the
removeAttribute() method of the
wrapped request. |
void |
setAttribute(String name,
Object value)
Override the
setAttribute() method of the
wrapped request. |
authenticate, changeSessionId, getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathTranslated, getRemoteUser, getRequestedSessionId, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isTrailerFieldsReady, isUserInRole, login, logout, upgradegetAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setCharacterEncoding, setRequest, startAsync, startAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, setCharacterEncoding, startAsync, startAsyncprotected Context context
protected String contextPath
protected boolean crossContext
protected javax.servlet.DispatcherType dispatcherType
protected Map<String,String[]> parameters
protected String pathInfo
protected String queryString
protected Object requestDispatcherPath
protected String requestURI
protected String servletPath
protected Session session
public ApplicationHttpRequest(javax.servlet.http.HttpServletRequest request,
Context context,
boolean crossContext,
javax.servlet.http.HttpServletMapping mappingForDispatch,
javax.servlet.DispatcherType dispatcherType)
request - the servlet request being wrappedcontext - the target context of the request dispatchcrossContext - true if this is a cross-context dispatch, false
otherwisedispatcherType - the dispatcher typepublic Object getAttribute(String name)
getAttribute() method of the wrapped request.getAttribute in interface javax.servlet.ServletRequestgetAttribute in class javax.servlet.ServletRequestWrappername - Name of the attribute to retrievepublic Enumeration<String> getAttributeNames()
getAttributeNames() method of the wrapped
request.getAttributeNames in interface javax.servlet.ServletRequestgetAttributeNames in class javax.servlet.ServletRequestWrapperpublic void removeAttribute(String name)
removeAttribute() method of the
wrapped request.removeAttribute in interface javax.servlet.ServletRequestremoveAttribute in class javax.servlet.ServletRequestWrappername - Name of the attribute to removepublic void setAttribute(String name, Object value)
setAttribute() method of the
wrapped request.setAttribute in interface javax.servlet.ServletRequestsetAttribute in class javax.servlet.ServletRequestWrappername - Name of the attribute to setvalue - Value of the attribute to setpublic javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface javax.servlet.ServletRequestgetRequestDispatcher in class javax.servlet.ServletRequestWrapperpath - Path of the resource to be wrappedpublic javax.servlet.DispatcherType getDispatcherType()
getDispatcherType in interface javax.servlet.ServletRequestgetDispatcherType in class javax.servlet.ServletRequestWrapperpublic String getContextPath()
getContextPath() method of the wrapped
request.getContextPath in interface javax.servlet.http.HttpServletRequestgetContextPath in class javax.servlet.http.HttpServletRequestWrapperpublic String getParameter(String name)
getParameter() method of the wrapped request.getParameter in interface javax.servlet.ServletRequestgetParameter in class javax.servlet.ServletRequestWrappername - Name of the requested parameterpublic Map<String,String[]> getParameterMap()
getParameterMap() method of the
wrapped request.getParameterMap in interface javax.servlet.ServletRequestgetParameterMap in class javax.servlet.ServletRequestWrapperpublic Enumeration<String> getParameterNames()
getParameterNames() method of the
wrapped request.getParameterNames in interface javax.servlet.ServletRequestgetParameterNames in class javax.servlet.ServletRequestWrapperpublic String[] getParameterValues(String name)
getParameterValues() method of the
wrapped request.getParameterValues in interface javax.servlet.ServletRequestgetParameterValues in class javax.servlet.ServletRequestWrappername - Name of the requested parameterpublic String getPathInfo()
getPathInfo() method of the wrapped request.getPathInfo in interface javax.servlet.http.HttpServletRequestgetPathInfo in class javax.servlet.http.HttpServletRequestWrapperpublic String getQueryString()
getQueryString() method of the wrapped
request.getQueryString in interface javax.servlet.http.HttpServletRequestgetQueryString in class javax.servlet.http.HttpServletRequestWrapperpublic String getRequestURI()
getRequestURI() method of the wrapped
request.getRequestURI in interface javax.servlet.http.HttpServletRequestgetRequestURI in class javax.servlet.http.HttpServletRequestWrapperpublic StringBuffer getRequestURL()
getRequestURL() method of the wrapped
request.getRequestURL in interface javax.servlet.http.HttpServletRequestgetRequestURL in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpServletMapping getHttpServletMapping()
getHttpServletMapping in interface javax.servlet.http.HttpServletRequestgetHttpServletMapping in class javax.servlet.http.HttpServletRequestWrapperpublic String getServletPath()
getServletPath() method of the wrapped
request.getServletPath in interface javax.servlet.http.HttpServletRequestgetServletPath in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestgetSession in class javax.servlet.http.HttpServletRequestWrappercreate - Create a new session if one does not existpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestisRequestedSessionIdValid in class javax.servlet.http.HttpServletRequestWrapperpublic javax.servlet.http.PushBuilder newPushBuilder()
newPushBuilder in interface javax.servlet.http.HttpServletRequestnewPushBuilder in class javax.servlet.http.HttpServletRequestWrapperpublic void recycle()
protected boolean isSpecial(String name)
name - Attribute name to be testedprotected String[] mergeValues(Object values1, Object values2)
values1 - First set of valuesvalues2 - Second set of valuespublic RequestFacade getRequestFacade()
Copyright © 2019. All rights reserved.