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, upgrade
getAsyncContext, 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, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsyncContext, 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, startAsync
protected WebappContext context
protected String contextPath
protected boolean crossContext
protected 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.ServletRequest
getAttribute
in class javax.servlet.ServletRequestWrapper
name
- Name of the attribute to retrievepublic Enumeration<String> getAttributeNames()
getAttributeNames()
method of the wrapped
request.getAttributeNames
in interface javax.servlet.ServletRequest
getAttributeNames
in class javax.servlet.ServletRequestWrapper
public void removeAttribute(String name)
removeAttribute()
method of the
wrapped request.removeAttribute
in interface javax.servlet.ServletRequest
removeAttribute
in class javax.servlet.ServletRequestWrapper
name
- Name of the attribute to removepublic void setAttribute(String name, Object value)
setAttribute()
method of the
wrapped request.setAttribute
in interface javax.servlet.ServletRequest
setAttribute
in class javax.servlet.ServletRequestWrapper
name
- Name of the attribute to setvalue
- Value of the attribute to setpublic javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher
in interface javax.servlet.ServletRequest
getRequestDispatcher
in class javax.servlet.ServletRequestWrapper
path
- Path of the resource to be wrappedpublic javax.servlet.DispatcherType getDispatcherType()
getDispatcherType
in interface javax.servlet.ServletRequest
getDispatcherType
in class javax.servlet.ServletRequestWrapper
public String getContextPath()
getContextPath()
method of the wrapped
request.getContextPath
in interface javax.servlet.http.HttpServletRequest
getContextPath
in class javax.servlet.http.HttpServletRequestWrapper
public String getParameter(String name)
getParameter()
method of the wrapped request.getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
name
- Name of the requested parameterpublic Map<String,String[]> getParameterMap()
getParameterMap()
method of the
wrapped request.getParameterMap
in interface javax.servlet.ServletRequest
getParameterMap
in class javax.servlet.ServletRequestWrapper
public Enumeration<String> getParameterNames()
getParameterNames()
method of the
wrapped request.getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
public String[] getParameterValues(String name)
getParameterValues()
method of the
wrapped request.getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper
name
- Name of the requested parameterpublic String getPathInfo()
getPathInfo()
method of the wrapped request.getPathInfo
in interface javax.servlet.http.HttpServletRequest
getPathInfo
in class javax.servlet.http.HttpServletRequestWrapper
public String getQueryString()
getQueryString()
method of the wrapped
request.getQueryString
in interface javax.servlet.http.HttpServletRequest
getQueryString
in class javax.servlet.http.HttpServletRequestWrapper
public String getRequestURI()
getRequestURI()
method of the wrapped
request.getRequestURI
in interface javax.servlet.http.HttpServletRequest
getRequestURI
in class javax.servlet.http.HttpServletRequestWrapper
public StringBuffer getRequestURL()
getRequestURL()
method of the wrapped
request.getRequestURL
in interface javax.servlet.http.HttpServletRequest
getRequestURL
in class javax.servlet.http.HttpServletRequestWrapper
public String getServletPath()
getServletPath()
method of the wrapped
request.getServletPath
in interface javax.servlet.http.HttpServletRequest
getServletPath
in class javax.servlet.http.HttpServletRequestWrapper
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 void recycle()
public HttpServletRequestImpl getRequestFacade()
Copyright © 2014 Oracle Corporation. All rights reserved.