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

    Fields
    Modifier and Type
    Field
    Description
    protected WebappContext
    The context for this request.
    protected String
    The context path for this request.
    protected boolean
    If this request is cross context, since this changes session access behavior.
    protected final javax.servlet.DispatcherType
    The dispatcher type.
    protected String
    The path information for this request.
    protected String
    The query string for this request.
    protected Object
    The current request dispatcher path.
    protected String
    The request URI for this request.
    protected String
    The servlet path for this request.

    Fields inherited from interface javax.servlet.http.HttpServletRequest

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • Constructor Summary

    Constructors
    Constructor
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    Override the getAttribute() method of the wrapped request.
    Override the getAttributeNames() method of the wrapped request.
    Override the getContextPath() method of the wrapped request.
    javax.servlet.DispatcherType
     
    Override the getParameter() method of the wrapped request.
    Override the getParameterMap() method of the wrapped request.
    Override the getParameterNames() method of the wrapped request.
    Override the getParameterValues() method of the wrapped request.
    Override the getPathInfo() method of the wrapped request.
    Override the getQueryString() method of the wrapped request.
    javax.servlet.RequestDispatcher
    Return a RequestDispatcher that wraps the resource at the specified path, which may be interpreted as relative to the current request path.
     
    Override the getRequestURI() method of the wrapped request.
    Override the getRequestURL() method of the wrapped request.
    Override the getServletPath() method of the wrapped request.
    protected boolean
    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
     
    void
    Override the removeAttribute() method of the wrapped request.
    void
    setAttribute(String name, Object value)
    Override the setAttribute() 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, upgrade

    Methods 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, startAsync

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      protected WebappContext 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 final javax.servlet.DispatcherType dispatcherType
      The dispatcher type.
    • 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.
  • 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 wrapped
      dispatcherType - the dispatcher type
  • Method Details

    • getAttribute

      public Object getAttribute(String name)
      Override the getAttribute() method of the wrapped request.
      Specified by:
      getAttribute in interface javax.servlet.ServletRequest
      Overrides:
      getAttribute in class javax.servlet.ServletRequestWrapper
      Parameters:
      name - Name of the attribute to retrieve
    • getAttributeNames

      public Enumeration<String> getAttributeNames()
      Override the getAttributeNames() method of the wrapped request.
      Specified by:
      getAttributeNames in interface javax.servlet.ServletRequest
      Overrides:
      getAttributeNames in class javax.servlet.ServletRequestWrapper
    • removeAttribute

      public void removeAttribute(String name)
      Override the removeAttribute() method of the wrapped request.
      Specified by:
      removeAttribute in interface javax.servlet.ServletRequest
      Overrides:
      removeAttribute in class javax.servlet.ServletRequestWrapper
      Parameters:
      name - Name of the attribute to remove
    • setAttribute

      public void setAttribute(String name, Object value)
      Override the setAttribute() method of the wrapped request.
      Specified by:
      setAttribute in interface javax.servlet.ServletRequest
      Overrides:
      setAttribute in class javax.servlet.ServletRequestWrapper
      Parameters:
      name - Name of the attribute to set
      value - Value of the attribute to set
    • getRequestDispatcher

      public 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.
      Specified by:
      getRequestDispatcher in interface javax.servlet.ServletRequest
      Overrides:
      getRequestDispatcher in class javax.servlet.ServletRequestWrapper
      Parameters:
      path - Path of the resource to be wrapped
    • getDispatcherType

      public javax.servlet.DispatcherType getDispatcherType()
      Specified by:
      getDispatcherType in interface javax.servlet.ServletRequest
      Overrides:
      getDispatcherType in class javax.servlet.ServletRequestWrapper
    • getContextPath

      public String getContextPath()
      Override the getContextPath() method of the wrapped request.
      Specified by:
      getContextPath in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getContextPath in class javax.servlet.http.HttpServletRequestWrapper
    • getParameter

      public String getParameter(String name)
      Override the getParameter() method of the wrapped request.
      Specified by:
      getParameter in interface javax.servlet.ServletRequest
      Overrides:
      getParameter in class javax.servlet.ServletRequestWrapper
      Parameters:
      name - Name of the requested parameter
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Override the getParameterMap() method of the wrapped request.
      Specified by:
      getParameterMap in interface javax.servlet.ServletRequest
      Overrides:
      getParameterMap in class javax.servlet.ServletRequestWrapper
    • getParameterNames

      public Enumeration<String> getParameterNames()
      Override the getParameterNames() method of the wrapped request.
      Specified by:
      getParameterNames in interface javax.servlet.ServletRequest
      Overrides:
      getParameterNames in class javax.servlet.ServletRequestWrapper
    • getParameterValues

      public String[] getParameterValues(String name)
      Override the getParameterValues() method of the wrapped request.
      Specified by:
      getParameterValues in interface javax.servlet.ServletRequest
      Overrides:
      getParameterValues in class javax.servlet.ServletRequestWrapper
      Parameters:
      name - Name of the requested parameter
    • getPathInfo

      public String getPathInfo()
      Override the getPathInfo() method of the wrapped request.
      Specified by:
      getPathInfo in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getPathInfo in class javax.servlet.http.HttpServletRequestWrapper
    • getQueryString

      public String getQueryString()
      Override the getQueryString() method of the wrapped request.
      Specified by:
      getQueryString in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getQueryString in class javax.servlet.http.HttpServletRequestWrapper
    • getRequestURI

      public String getRequestURI()
      Override the getRequestURI() method of the wrapped request.
      Specified by:
      getRequestURI in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getRequestURI in class javax.servlet.http.HttpServletRequestWrapper
    • getRequestURL

      public StringBuffer getRequestURL()
      Override the getRequestURL() method of the wrapped request.
      Specified by:
      getRequestURL in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getRequestURL in class javax.servlet.http.HttpServletRequestWrapper
    • getServletPath

      public String getServletPath()
      Override the getServletPath() method of the wrapped request.
      Specified by:
      getServletPath in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getServletPath in class javax.servlet.http.HttpServletRequestWrapper
    • 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 values
      values2 - Second set of values
    • recycle

      public void recycle()
    • getRequestFacade

      public HttpServletRequestImpl getRequestFacade()