Package org.glassfish.grizzly.servlet
Class DispatchedHttpServletRequest
java.lang.Object
javax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.glassfish.grizzly.servlet.DispatchedHttpServletRequest
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
public class DispatchedHttpServletRequest
extends javax.servlet.http.HttpServletRequestWrapper
Wrapper around a
javax.servlet.http.HttpServletRequest
that transforms an application request object (which might be the original
one passed to a servlet.- Author:
- Bongjae Chang
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WebappContextThe context for this request.protected StringThe context path for this request.protected booleanIf this request is cross context, since this changes session access behavior.protected final javax.servlet.DispatcherTypeThe dispatcher type.protected StringThe path information for this request.protected StringThe query string for this request.protected ObjectThe current request dispatcher path.protected StringThe request URI for this request.protected StringThe servlet path for this request.Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsConstructorDescriptionDispatchedHttpServletRequest(javax.servlet.http.HttpServletRequest request, WebappContext context, boolean crossContext, javax.servlet.DispatcherType dispatcherType) Construct a new wrapped request around the specified servlet request. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Override thegetAttribute()method of the wrapped request.Override thegetAttributeNames()method of the wrapped request.Override thegetContextPath()method of the wrapped request.javax.servlet.DispatcherTypegetParameter(String name) Override thegetParameter()method of the wrapped request.Override thegetParameterMap()method of the wrapped request.Override thegetParameterNames()method of the wrapped request.String[]getParameterValues(String name) Override thegetParameterValues()method of the wrapped request.Override thegetPathInfo()method of the wrapped request.Override thegetQueryString()method of the wrapped request.javax.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.Override thegetRequestURI()method of the wrapped request.Override thegetRequestURL()method of the wrapped request.Override thegetServletPath()method of the wrapped request.protected booleanIs 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.voidrecycle()voidremoveAttribute(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 javax.servlet.http.HttpServletRequestWrapper
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, upgradeMethods inherited from class javax.servlet.ServletRequestWrapper
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, startAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.ServletRequest
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
-
Field Details
-
context
The context for this request. -
contextPath
The context path for this request. -
crossContext
protected boolean crossContextIf this request is cross context, since this changes session access behavior. -
dispatcherType
protected final javax.servlet.DispatcherType dispatcherTypeThe dispatcher type. -
pathInfo
The path information for this request. -
queryString
The query string for this request. -
requestDispatcherPath
The current request dispatcher path. -
requestURI
The request URI for this request. -
servletPath
The servlet path for this request.
-
-
Constructor Details
-
DispatchedHttpServletRequest
public DispatchedHttpServletRequest(javax.servlet.http.HttpServletRequest request, WebappContext context, boolean crossContext, javax.servlet.DispatcherType dispatcherType) Construct a new wrapped request around the specified servlet request.- Parameters:
request- the servlet request being wrappeddispatcherType- the dispatcher type
-
-
Method Details
-
getAttribute
Override thegetAttribute()method of the wrapped request.- Specified by:
getAttributein interfacejavax.servlet.ServletRequest- Overrides:
getAttributein classjavax.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to retrieve
-
getAttributeNames
Override thegetAttributeNames()method of the wrapped request.- Specified by:
getAttributeNamesin interfacejavax.servlet.ServletRequest- Overrides:
getAttributeNamesin classjavax.servlet.ServletRequestWrapper
-
removeAttribute
Override theremoveAttribute()method of the wrapped request.- Specified by:
removeAttributein interfacejavax.servlet.ServletRequest- Overrides:
removeAttributein classjavax.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to remove
-
setAttribute
Override thesetAttribute()method of the wrapped request.- Specified by:
setAttributein interfacejavax.servlet.ServletRequest- Overrides:
setAttributein classjavax.servlet.ServletRequestWrapper- Parameters:
name- Name of the attribute to setvalue- Value of the attribute to set
-
getRequestDispatcher
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 interfacejavax.servlet.ServletRequest- Overrides:
getRequestDispatcherin classjavax.servlet.ServletRequestWrapper- Parameters:
path- Path of the resource to be wrapped
-
getDispatcherType
public javax.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejavax.servlet.ServletRequest- Overrides:
getDispatcherTypein classjavax.servlet.ServletRequestWrapper
-
getContextPath
Override thegetContextPath()method of the wrapped request.- Specified by:
getContextPathin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getContextPathin classjavax.servlet.http.HttpServletRequestWrapper
-
getParameter
Override thegetParameter()method of the wrapped request.- Specified by:
getParameterin interfacejavax.servlet.ServletRequest- Overrides:
getParameterin classjavax.servlet.ServletRequestWrapper- Parameters:
name- Name of the requested parameter
-
getParameterMap
Override thegetParameterMap()method of the wrapped request.- Specified by:
getParameterMapin interfacejavax.servlet.ServletRequest- Overrides:
getParameterMapin classjavax.servlet.ServletRequestWrapper
-
getParameterNames
Override thegetParameterNames()method of the wrapped request.- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterNamesin classjavax.servlet.ServletRequestWrapper
-
getParameterValues
Override thegetParameterValues()method of the wrapped request.- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterValuesin classjavax.servlet.ServletRequestWrapper- Parameters:
name- Name of the requested parameter
-
getPathInfo
Override thegetPathInfo()method of the wrapped request.- Specified by:
getPathInfoin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getPathInfoin classjavax.servlet.http.HttpServletRequestWrapper
-
getQueryString
Override thegetQueryString()method of the wrapped request.- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getQueryStringin classjavax.servlet.http.HttpServletRequestWrapper
-
getRequestURI
Override thegetRequestURI()method of the wrapped request.- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getRequestURIin classjavax.servlet.http.HttpServletRequestWrapper
-
getRequestURL
Override thegetRequestURL()method of the wrapped request.- Specified by:
getRequestURLin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getRequestURLin classjavax.servlet.http.HttpServletRequestWrapper
-
getServletPath
Override thegetServletPath()method of the wrapped request.- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getServletPathin classjavax.servlet.http.HttpServletRequestWrapper
-
isSpecial
Is this attribute name one of the special ones that is added only for included servlets?- Parameters:
name- Attribute name to be tested
-
mergeValues
Merge the two sets of parameter values into a single String array.- Parameters:
values1- First set of valuesvalues2- Second set of values
-
recycle
public void recycle() -
getRequestFacade
-