public class DispatchedHttpServletRequest
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.| Modifier and Type | Field and Description |
|---|---|
protected WebappContext |
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 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.
|
| Constructor and Description |
|---|
DispatchedHttpServletRequest(javax.servlet.http.HttpServletRequest request,
WebappContext context,
boolean crossContext,
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() |
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.
|
HttpServletRequestImpl |
getRequestFacade() |
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. |
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.
|
void |
recycle() |
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, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, 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 WebappContext context
protected String contextPath
protected boolean crossContext
protected final javax.servlet.DispatcherType dispatcherType
protected String pathInfo
protected String queryString
protected Object requestDispatcherPath
protected String requestURI
protected String servletPath
public DispatchedHttpServletRequest(javax.servlet.http.HttpServletRequest request,
WebappContext context,
boolean crossContext,
javax.servlet.DispatcherType dispatcherType)
request - the servlet request being wrappeddispatcherType - 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 String getServletPath()
getServletPath() method of the wrapped
request.getServletPath in interface javax.servlet.http.HttpServletRequestgetServletPath in class javax.servlet.http.HttpServletRequestWrapperprotected 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 void recycle()
public HttpServletRequestImpl getRequestFacade()
Copyright © 2020 Oracle Corporation. All Rights Reserved.