Package org.apache.catalina.core
Class ApplicationHttpRequest
- java.lang.Object
-
- jakarta.servlet.ServletRequestWrapper
-
- jakarta.servlet.http.HttpServletRequestWrapper
-
- org.apache.catalina.core.ApplicationHttpRequest
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletRequest
public class ApplicationHttpRequest extends jakarta.servlet.http.HttpServletRequestWrapperWrapper around ajakarta.servlet.http.HttpServletRequestthat transforms an application request object (which might be the original one passed to a servlet, or might be based on the 2.3jakarta.servlet.http.HttpServletRequestWrapperclass) back into an internalorg.apache.catalina.HttpRequest.- Version:
- $Revision: 1.15 $ $Date: 2007/05/03 21:58:54 $
- Author:
- Craig R. McClanahan, Remy Maucherat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classApplicationHttpRequest.AttributeNamesEnumeratorUtility class used to expose the special attributes as being available as request attributes.
-
Field Summary
Fields Modifier and Type Field Description protected ContextcontextThe context for this request.protected StringcontextPathThe context path for this request.protected booleancrossContextIf this request is cross context, since this changes session access behavior.protected jakarta.servlet.DispatcherTypedispatcherTypeThe dispatcher type.protected Map<String,String[]>parametersThe request parameters for this request.protected StringpathInfoThe path information for this request.protected StringqueryStringThe query string for this request.protected ObjectrequestDispatcherPathThe current request dispatcher path.protected StringrequestURIThe request URI for this request.protected StringservletPathThe servlet path for this request.protected SessionsessionThe currently active session for this request.
-
Constructor Summary
Constructors Constructor Description ApplicationHttpRequest(jakarta.servlet.http.HttpServletRequest request, Context context, boolean crossContext, jakarta.servlet.http.HttpServletMapping mappingForDispatch, jakarta.servlet.DispatcherType dispatcherType)Construct a new wrapped request around the specified servlet request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)Override thegetAttribute()method of the wrapped request.Enumeration<String>getAttributeNames()Override thegetAttributeNames()method of the wrapped request.StringgetContextPath()Override thegetContextPath()method of the wrapped request.jakarta.servlet.DispatcherTypegetDispatcherType()jakarta.servlet.http.HttpServletMappinggetHttpServletMapping()StringgetParameter(String name)Override thegetParameter()method of the wrapped request.Map<String,String[]>getParameterMap()Override thegetParameterMap()method of the wrapped request.Enumeration<String>getParameterNames()Override thegetParameterNames()method of the wrapped request.String[]getParameterValues(String name)Override thegetParameterValues()method of the wrapped request.StringgetPathInfo()Override thegetPathInfo()method of the wrapped request.StringgetQueryString()Override thegetQueryString()method of the wrapped request.jakarta.servlet.RequestDispatchergetRequestDispatcher(String path)Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.RequestFacadegetRequestFacade()Gets the facade for the request implementation object.StringgetRequestURI()Override thegetRequestURI()method of the wrapped request.StringBuffergetRequestURL()Override thegetRequestURL()method of the wrapped request.StringgetServletPath()Override thegetServletPath()method of the wrapped request.jakarta.servlet.http.HttpSessiongetSession()Return the session associated with this Request, creating one if necessary.jakarta.servlet.http.HttpSessiongetSession(boolean create)Return the session associated with this Request, creating one if necessary and requested.booleanisRequestedSessionIdValid()Returns true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise.protected booleanisSpecial(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.jakarta.servlet.http.PushBuildernewPushBuilder()voidrecycle()Recycle this requestvoidremoveAttribute(String name)Override theremoveAttribute()method of the wrapped request.voidsetAttribute(String name, Object value)Override thesetAttribute()method of the wrapped request.-
Methods inherited from class jakarta.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathTranslated, getRemoteUser, getRequestedSessionId, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromURL, isTrailerFieldsReady, isUserInRole, login, logout, upgrade
-
Methods inherited from class jakarta.servlet.ServletRequestWrapper
getAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setCharacterEncoding, setRequest, startAsync, startAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.servlet.ServletRequest
getAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getProtocolRequestId, getReader, getRemoteAddr, getRemoteHost, getRemotePort, getRequestId, getScheme, getServerName, getServerPort, getServletConnection, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Field Detail
-
context
protected Context context
The context for this request.
-
contextPath
protected String contextPath
The context path for this request.
-
crossContext
protected boolean crossContext
If this request is cross context, since this changes session access behavior.
-
dispatcherType
protected jakarta.servlet.DispatcherType dispatcherType
The dispatcher type.
-
parameters
protected Map<String,String[]> parameters
The request parameters for this request. This is initialized from the wrapped request, but updates are allowed.
-
pathInfo
protected String pathInfo
The path information for this request.
-
queryString
protected String queryString
The query string for this request.
-
requestDispatcherPath
protected Object requestDispatcherPath
The current request dispatcher path.
-
requestURI
protected String requestURI
The request URI for this request.
-
servletPath
protected String servletPath
The servlet path for this request.
-
session
protected Session session
The currently active session for this request.
-
-
Constructor Detail
-
ApplicationHttpRequest
public ApplicationHttpRequest(jakarta.servlet.http.HttpServletRequest request, Context context, boolean crossContext, jakarta.servlet.http.HttpServletMapping mappingForDispatch, jakarta.servlet.DispatcherType dispatcherType)Construct a new wrapped request around the specified servlet request.- Parameters:
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 type
-
-
Method Detail
-
getAttribute
public Object getAttribute(String name)
Override thegetAttribute()method of the wrapped request.- Specified by:
getAttributein interfacejakarta.servlet.ServletRequest- Overrides:
getAttributein classjakarta.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to retrieve
-
getAttributeNames
public Enumeration<String> getAttributeNames()
Override thegetAttributeNames()method of the wrapped request.- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest- Overrides:
getAttributeNamesin classjakarta.servlet.ServletRequestWrapper
-
removeAttribute
public void removeAttribute(String name)
Override theremoveAttribute()method of the wrapped request.- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest- Overrides:
removeAttributein classjakarta.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to remove
-
setAttribute
public void setAttribute(String name, Object value)
Override thesetAttribute()method of the wrapped request.- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest- Overrides:
setAttributein classjakarta.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to setvalue- Value of the attribute to set
-
getRequestDispatcher
public jakarta.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.- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest- Overrides:
getRequestDispatcherin classjakarta.servlet.ServletRequestWrapper- Parameters:
path- Path of the resource to be wrapped
-
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType()
- Specified by:
getDispatcherTypein interfacejakarta.servlet.ServletRequest- Overrides:
getDispatcherTypein classjakarta.servlet.ServletRequestWrapper
-
getContextPath
public String getContextPath()
Override thegetContextPath()method of the wrapped request.- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getContextPathin classjakarta.servlet.http.HttpServletRequestWrapper
-
getParameter
public String getParameter(String name)
Override thegetParameter()method of the wrapped request.- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest- Overrides:
getParameterin classjakarta.servlet.ServletRequestWrapper- Parameters:
name- Name of the requested parameter
-
getParameterMap
public Map<String,String[]> getParameterMap()
Override thegetParameterMap()method of the wrapped request.- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest- Overrides:
getParameterMapin classjakarta.servlet.ServletRequestWrapper
-
getParameterNames
public Enumeration<String> getParameterNames()
Override thegetParameterNames()method of the wrapped request.- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest- Overrides:
getParameterNamesin classjakarta.servlet.ServletRequestWrapper
-
getParameterValues
public String[] getParameterValues(String name)
Override thegetParameterValues()method of the wrapped request.- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest- Overrides:
getParameterValuesin classjakarta.servlet.ServletRequestWrapper- Parameters:
name- Name of the requested parameter
-
getPathInfo
public String getPathInfo()
Override thegetPathInfo()method of the wrapped request.- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getPathInfoin classjakarta.servlet.http.HttpServletRequestWrapper
-
getQueryString
public String getQueryString()
Override thegetQueryString()method of the wrapped request.- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getQueryStringin classjakarta.servlet.http.HttpServletRequestWrapper
-
getRequestURI
public String getRequestURI()
Override thegetRequestURI()method of the wrapped request.- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getRequestURIin classjakarta.servlet.http.HttpServletRequestWrapper
-
getRequestURL
public StringBuffer getRequestURL()
Override thegetRequestURL()method of the wrapped request.- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getRequestURLin classjakarta.servlet.http.HttpServletRequestWrapper
-
getHttpServletMapping
public jakarta.servlet.http.HttpServletMapping getHttpServletMapping()
- Specified by:
getHttpServletMappingin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getHttpServletMappingin classjakarta.servlet.http.HttpServletRequestWrapper
-
getServletPath
public String getServletPath()
Override thegetServletPath()method of the wrapped request.- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getServletPathin classjakarta.servlet.http.HttpServletRequestWrapper
-
getSession
public jakarta.servlet.http.HttpSession getSession()
Return the session associated with this Request, creating one if necessary.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getSessionin classjakarta.servlet.http.HttpServletRequestWrapper
-
getSession
public jakarta.servlet.http.HttpSession getSession(boolean create)
Return the session associated with this Request, creating one if necessary and requested.- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
getSessionin classjakarta.servlet.http.HttpServletRequestWrapper- Parameters:
create- Create a new session if one does not exist
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
Returns true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise.- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
isRequestedSessionIdValidin classjakarta.servlet.http.HttpServletRequestWrapper- Returns:
- true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise.
-
newPushBuilder
public jakarta.servlet.http.PushBuilder newPushBuilder()
- Specified by:
newPushBuilderin interfacejakarta.servlet.http.HttpServletRequest- Overrides:
newPushBuilderin classjakarta.servlet.http.HttpServletRequestWrapper
-
recycle
public void recycle()
Recycle this request
-
isSpecial
protected boolean isSpecial(String name)
Is this attribute name one of the special ones that is added only for included servlets?- Parameters:
name- Attribute name to be tested
-
mergeValues
protected String[] mergeValues(Object values1, Object values2)
Merge the two sets of parameter values into a single String array.- Parameters:
values1- First set of valuesvalues2- Second set of values
-
getRequestFacade
public RequestFacade getRequestFacade()
Gets the facade for the request implementation object.
-
-