Class DefaultSavedRequest

  • All Implemented Interfaces:, SavedRequest

    public class DefaultSavedRequest
    extends java.lang.Object
    implements SavedRequest
    Represents central information from a HttpServletRequest.

    This class is used by AbstractAuthenticationProcessingFilter and SavedRequestAwareWrapper to reproduce the request after successful authentication. An instance of this class is stored at the time of an authentication exception by ExceptionTranslationFilter.

    IMPLEMENTATION NOTE: It is assumed that this object is accessed only from the context of a single thread, so no synchronization around internal collection classes is performed.

    This class is based on code in Apache Tomcat.

    See Also:
    Serialized Form
    • Field Detail

      • logger

        protected static final org.apache.commons.logging.Log logger
    • Constructor Detail

      • DefaultSavedRequest

        public DefaultSavedRequest​(javax.servlet.http.HttpServletRequest request,
                                   PortResolver portResolver)
    • Method Detail

      • doesRequestMatch

        public boolean doesRequestMatch​(javax.servlet.http.HttpServletRequest request,
                                        PortResolver portResolver)
        Determines if the current request matches the DefaultSavedRequest.

        All URL arguments are considered but not cookies, locales, headers or parameters.

        request - the actual request to be matched against this one
        portResolver - used to obtain the server port of the request
        true if the request is deemed to match this one.
      • getContextPath

        public java.lang.String getContextPath()
      • getCookies

        public java.util.List<javax.servlet.http.Cookie> getCookies()
        Specified by:
        getCookies in interface SavedRequest
      • getRedirectUrl

        public java.lang.String getRedirectUrl()
        Indicates the URL that the user agent used for this request.
        Specified by:
        getRedirectUrl in interface SavedRequest
        the full URL of this request
      • getHeaderNames

        public java.util.Collection<java.lang.String> getHeaderNames()
        Specified by:
        getHeaderNames in interface SavedRequest
      • getHeaderValues

        public java.util.List<java.lang.String> getHeaderValues​(java.lang.String name)
        Specified by:
        getHeaderValues in interface SavedRequest
      • getLocales

        public java.util.List<java.util.Locale> getLocales()
        Specified by:
        getLocales in interface SavedRequest
      • getParameterMap

        public java.util.Map<java.lang.String,​java.lang.String[]> getParameterMap()
        Specified by:
        getParameterMap in interface SavedRequest
      • getParameterNames

        public java.util.Collection<java.lang.String> getParameterNames()
      • getParameterValues

        public java.lang.String[] getParameterValues​(java.lang.String name)
        Specified by:
        getParameterValues in interface SavedRequest
      • getPathInfo

        public java.lang.String getPathInfo()
      • getQueryString

        public java.lang.String getQueryString()
      • getRequestURI

        public java.lang.String getRequestURI()
      • getRequestURL

        public java.lang.String getRequestURL()
      • getScheme

        public java.lang.String getScheme()
      • getServerName

        public java.lang.String getServerName()
      • getServerPort

        public int getServerPort()
      • getServletPath

        public java.lang.String getServletPath()
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object