jakarta.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
jakarta.servlet.http.HttpServletRequestWrapper class) back into an internal
org.apache.catalina.HttpRequest.Warning
Due to Java's lack of support for multiple inheritance, all of the logic in
ApplicationRequest is duplicated in ApplicationHttpRequest. Make sure that you keep these
two classes in synchronization when making changes!
| Modifier and Type | Class and Description |
|---|---|
| protected class | ApplicationHttpRequest.
Utility class used to expose the special attributes as being available as request attributes. |
| Modifier and Type | Field and Description |
|---|---|
| protected final Context | context
The context for this request. |
| protected String | contextPath
The context path for this request. |
| protected final boolean | crossContext
If this request is cross context, since this changes session access behavior. |
| protected DispatcherType | dispatcherType
The current dispatcher type. |
| private HttpServletMapping | mapping
The mapping for this request. |
| protected Map | parameters
The request parameters for this request. |
| private boolean | parsedParams
Have the parameters for this request already been parsed? |
| protected String | pathInfo
The path information for this request. |
| private String | queryParamString
The query parameters for the current 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. |
| private static final int | |
| private static final StringManager | |
| protected final Object[] | specialAttributes
Special attributes. |
| protected static final String[] | specials
The set of attribute names that are special for request dispatchers. |
| private static final int | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv | ApplicationHttpRequest(HttpServletRequest
The servlet request being wrapped request, Context The target context for the wrapped request context, boolean true if the wrapped request will be a cross-context request, otherwise falseConstruct a new wrapped request around the specified servlet request. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getAttribute(String
Name of the attribute to retrieve name)Overrides jakarta. Implements jakarta. Override the |
| public Enumeration | getAttributeNames()
Overrides jakarta. Implements jakarta. Override the |
| public String | getContextPath()
Overrides jakarta. Implements jakarta. Override the |
| public DispatcherType | getDispatcherType()
Overrides jakarta. Implements jakarta. Override the getDispatcherType() method of the wrapped request. |
| public HttpServletMapping | getHttpServletMapping()
Overrides jakarta. Overrides default jakarta. The default behavior of this method is to return |
| public String | getParameter(String
Name of the requested parameter name)Overrides jakarta. Implements jakarta. Override the |
| public Map | getParameterMap()
Overrides jakarta. Implements jakarta. Override the |
| public Enumeration | getParameterNames()
Overrides jakarta. Implements jakarta. Override the |
| public String[] | getParameterValues(String
Name of the requested parameter name)Overrides jakarta. Implements jakarta. Override the |
| public String | getPathInfo()
Overrides jakarta. Implements jakarta. Override the |
| public String | getPathTranslated()
Overrides jakarta. Implements jakarta. Override the |
| public String | getQueryString()
Overrides jakarta. Implements jakarta. Override the |
| public RequestDispatcher | getRequestDispatcher(String
Path of the resource to be wrapped path)Overrides jakarta. Implements jakarta. Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path. |
| public String | getRequestURI()
Overrides jakarta. Implements jakarta. Override the |
| public StringBuffer | getRequestURL()
Overrides jakarta. Implements jakarta. Override the |
| public ServletContext | getServletContext()
Overrides jakarta. Implements jakarta. The default behavior of this method is to return getServletContext() on the wrapped request object. |
| public String | getServletPath()
Overrides jakarta. Implements jakarta. Override the |
| public HttpSession | getSession()
Overrides jakarta. Implements jakarta. Return the session associated with this Request, creating one if necessary. |
| public HttpSession | getSession(boolean
Create a new session if one does not exist create)Overrides jakarta. Implements jakarta. Return the session associated with this Request, creating one if necessary and requested. |
| protected int | Returns: the special attribute pos, or -1 if it is not a special attributeGet a special attribute. |
| public boolean | Returns: true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise.Overrides jakarta. Implements jakarta. Returns true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise. |
| protected boolean | |
| private void | mergeParameters()
Merge the parameters from the saved query parameter string (if any), and the parameters already present on this request (if any), such that the parameter values from the query string show up first if there are duplicate parameter names. |
| private String[] | mergeValues(String[]
First set of values values1, String[] Second set of values values2)Merge the two sets of parameter values into a single String array. |
| public PushBuilder | newPushBuilder()
Overrides jakarta. Overrides default jakarta. Obtain a builder for generating push requests. |
| pack-priv void | |
| public void | |
| public void | removeAttribute(String
Name of the attribute to remove name)Overrides jakarta. Implements jakarta. Override the |
| protected boolean | Returns: true if the attribute was a special attribute, false otherwiseRemove a special attribute. |
| public void | setAttribute(String
Name of the attribute to set name, Object Value of the attribute to set value)Overrides jakarta. Implements jakarta. Override the |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | setQueryParams(String
The query string containing parameters for this request queryString)Save query parameters for this request. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| protected boolean | Returns: true if the attribute was a special attribute, false otherwiseSet a special attribute. |
| context | back to summary |
|---|---|
| protected final Context context The context for this request. | |
| contextPath | back to summary |
|---|---|
| protected String contextPath The context path for this request. | |
| crossContext | back to summary |
|---|---|
| protected final boolean crossContext If this request is cross context, since this changes session access behavior. | |
| dispatcherType | back to summary |
|---|---|
| protected DispatcherType dispatcherType The current dispatcher type. | |
| mapping | back to summary |
|---|---|
| private HttpServletMapping mapping The mapping for this request. | |
| parameters | back to summary |
|---|---|
| protected Map<String, String[]> parameters The request parameters for this request. This is initialized from the wrapped request. | |
| parsedParams | back to summary |
|---|---|
| private boolean parsedParams Have the parameters for this request already been parsed? | |
| pathInfo | back to summary |
|---|---|
| protected String pathInfo The path information for this request. | |
| queryParamString | back to summary |
|---|---|
| private String queryParamString The query parameters for the current request. | |
| queryString | back to summary |
|---|---|
| protected String queryString The query string for this request. | |
| requestDispatcherPath | back to summary |
|---|---|
| protected Object requestDispatcherPath The current request dispatcher path. | |
| requestURI | back to summary |
|---|---|
| protected String requestURI The request URI for this request. | |
| servletPath | back to summary |
|---|---|
| protected String servletPath The servlet path for this request. | |
| session | back to summary |
|---|---|
| protected Session session The currently active session for this request. | |
| shortestSpecialNameLength | back to summary |
|---|---|
| private static final int shortestSpecialNameLength | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| specialAttributes | back to summary |
|---|---|
| protected final Object[] specialAttributes Special attributes. | |
| specials | back to summary |
|---|---|
| protected static final String[] specials The set of attribute names that are special for request dispatchers. | |
| SPECIALS_FIRST_FORWARD_INDEX | back to summary |
|---|---|
| private static final int SPECIALS_FIRST_FORWARD_INDEX | |
| specialsMap | back to summary |
|---|---|
| private static final Map<String, Integer> specialsMap | |
| ApplicationHttpRequest | back to summary |
|---|---|
| pack-priv ApplicationHttpRequest(HttpServletRequest request, Context context, boolean crossContext) Construct a new wrapped request around the specified servlet request.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Overrides jakarta. Implements jakarta. Override the
| |
| getAttributeNames | back to summary |
|---|---|
| public Enumeration Overrides jakarta. Implements jakarta. Override the
| |
| getContextPath | back to summary |
|---|---|
| public String getContextPath() Overrides jakarta. Implements jakarta. Override the
| |
| getDispatcherType | back to summary |
|---|---|
| public DispatcherType getDispatcherType() Overrides jakarta. Implements jakarta. Override the getDispatcherType() method of the wrapped request.
| |
| getHttpServletMapping | back to summary |
|---|---|
| public HttpServletMapping getHttpServletMapping() Overrides jakarta. Overrides default jakarta. Doc from jakarta. The default behavior of this method is to return
| |
| getParameter | back to summary |
|---|---|
| public String getParameter(String name) Overrides jakarta. Implements jakarta. Override the
| |
| getParameterMap | back to summary |
|---|---|
| public Map Overrides jakarta. Implements jakarta. Override the
| |
| getParameterNames | back to summary |
|---|---|
| public Enumeration Overrides jakarta. Implements jakarta. Override the
| |
| getParameterValues | back to summary |
|---|---|
| public String[] getParameterValues(String name) Overrides jakarta. Implements jakarta. Override the
| |
| getPathInfo | back to summary |
|---|---|
| public String getPathInfo() Overrides jakarta. Implements jakarta. Override the
| |
| getPathTranslated | back to summary |
|---|---|
| public String getPathTranslated() Overrides jakarta. Implements jakarta. Override the
| |
| getQueryString | back to summary |
|---|---|
| public String getQueryString() Overrides jakarta. Implements jakarta. Override the
| |
| getRequestDispatcher | back to summary |
|---|---|
| public RequestDispatcher getRequestDispatcher(String path) Overrides jakarta. Implements jakarta. Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
| |
| getRequestURI | back to summary |
|---|---|
| public String getRequestURI() Overrides jakarta. Implements jakarta. Override the
| |
| getRequestURL | back to summary |
|---|---|
| public StringBuffer getRequestURL() Overrides jakarta. Implements jakarta. Override the
| |
| getServletContext | back to summary |
|---|---|
| public ServletContext getServletContext() Overrides jakarta. Implements jakarta. Doc from jakarta. The default behavior of this method is to return getServletContext() on the wrapped request object.
| |
| getServletPath | back to summary |
|---|---|
| public String getServletPath() Overrides jakarta. Implements jakarta. Override the
| |
| getSession | back to summary |
|---|---|
| public HttpSession getSession() Overrides jakarta. Implements jakarta. Return the session associated with this Request, creating one if necessary.
| |
| getSession | back to summary |
|---|---|
| public HttpSession getSession(boolean create) Overrides jakarta. Implements jakarta. Return the session associated with this Request, creating one if necessary and requested.
| |
| getSpecial | back to summary |
|---|---|
| protected int getSpecial(String name) Get a special attribute.
| |
| isRequestedSessionIdValid | back to summary |
|---|---|
| public boolean isRequestedSessionIdValid() Overrides jakarta. Implements jakarta. Returns true if the request specifies a JSESSIONID that is valid within the context of this ApplicationHttpRequest, false otherwise.
| |
| isSpecial | back to summary |
|---|---|
| protected boolean isSpecial(String name) Is this attribute name one of the special ones that is added only for included servlets?
| |
| mergeParameters | back to summary |
|---|---|
| private void mergeParameters() Merge the parameters from the saved query parameter string (if any), and the parameters already present on this request (if any), such that the parameter values from the query string show up first if there are duplicate parameter names. | |
| mergeValues | back to summary |
|---|---|
| private String[] mergeValues(String[] values1, String[] values2) Merge the two sets of parameter values into a single String array. | |
| newPushBuilder | back to summary |
|---|---|
| public PushBuilder newPushBuilder() Overrides jakarta. Overrides default jakarta. Doc from jakarta. Obtain a builder for generating push requests.
The default behavior of this method is to return
| |
| parseParameters | back to summary |
|---|---|
| pack-priv void parseParameters() Parses the parameters of this request. If parameters are present in both the query string and the request content, they are merged. | |
| recycle | back to summary |
|---|---|
| public void recycle() Recycle this request | |
| removeAttribute | back to summary |
|---|---|
| public void removeAttribute(String name) Overrides jakarta. Implements jakarta. Override the | |
| removeSpecial | back to summary |
|---|---|
| protected boolean removeSpecial(String name) Remove a special attribute.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(String name, Object value) Overrides jakarta. Implements jakarta. Override the | |
| setContextPath | back to summary |
|---|---|
| pack-priv void setContextPath(String contextPath) Set the context path for this request.
| |
| setMapping | back to summary |
|---|---|
| pack-priv void setMapping(HttpServletMapping mapping) | |
| setPathInfo | back to summary |
|---|---|
| pack-priv void setPathInfo(String pathInfo) Set the path information for this request.
| |
| setQueryParams | back to summary |
|---|---|
| pack-priv void setQueryParams(String queryString) Save query parameters for this request.
| |
| setQueryString | back to summary |
|---|---|
| pack-priv void setQueryString(String queryString) Set the query string for this request.
| |
| setRequest | back to summary |
|---|---|
| pack-priv void setRequest(HttpServletRequest request) Set the request that we are wrapping.
| |
| setRequestURI | back to summary |
|---|---|
| pack-priv void setRequestURI(String requestURI) Set the request URI for this request.
| |
| setServletPath | back to summary |
|---|---|
| pack-priv void setServletPath(String servletPath) Set the servlet path for this request.
| |
| setSpecial | back to summary |
|---|---|
| protected boolean setSpecial(String name, Object value) Set a special attribute.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected final int | |
| protected String | |
| protected final Enumeration | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | |
| public boolean | hasMoreElements()
Implements java. Tests if this enumeration contains more elements. |
| public String | nextElement()
Implements java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. |
| last | back to summary |
|---|---|
| protected final int last | |
| next | back to summary |
|---|---|
| protected String next | |
| parentEnumeration | back to summary |
|---|---|
| protected final Enumeration<String> parentEnumeration | |
| pos | back to summary |
|---|---|
| protected int pos | |
| AttributeNamesEnumerator | back to summary |
|---|---|
| public AttributeNamesEnumerator() | |
| findNext | back to summary |
|---|---|
| protected String findNext() | |
| hasMoreElements | back to summary |
|---|---|
| public boolean hasMoreElements() Implements java. Doc from java. Tests if this enumeration contains more elements.
| |
| nextElement | back to summary |
|---|---|
| public String nextElement() Implements java. Doc from java. Returns the next element of this enumeration if this enumeration object has at least one more element to provide. | |