Class DefaultSavedRequest
- java.lang.Object
-
- org.springframework.security.web.savedrequest.DefaultSavedRequest
-
- All Implemented Interfaces:
java.io.Serializable
,SavedRequest
public class DefaultSavedRequest extends java.lang.Object implements SavedRequest
Represents central information from aHttpServletRequest
.This class is used by
AbstractAuthenticationProcessingFilter
andSavedRequestAwareWrapper
to reproduce the request after successful authentication. An instance of this class is stored at the time of an authentication exception byExceptionTranslationFilter
.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultSavedRequest.Builder
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
logger
-
Constructor Summary
Constructors Constructor Description DefaultSavedRequest(javax.servlet.http.HttpServletRequest request, PortResolver portResolver)
DefaultSavedRequest(javax.servlet.http.HttpServletRequest request, PortResolver portResolver, java.lang.String matchingRequestParameterName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doesRequestMatch(javax.servlet.http.HttpServletRequest request, PortResolver portResolver)
Determines if the current request matches theDefaultSavedRequest
.java.lang.String
getContextPath()
java.util.List<javax.servlet.http.Cookie>
getCookies()
java.util.Collection<java.lang.String>
getHeaderNames()
java.util.List<java.lang.String>
getHeaderValues(java.lang.String name)
java.util.List<java.util.Locale>
getLocales()
java.lang.String
getMethod()
java.util.Map<java.lang.String,java.lang.String[]>
getParameterMap()
java.util.Collection<java.lang.String>
getParameterNames()
java.lang.String[]
getParameterValues(java.lang.String name)
java.lang.String
getPathInfo()
java.lang.String
getQueryString()
java.lang.String
getRedirectUrl()
Indicates the URL that the user agent used for this request.java.lang.String
getRequestURI()
java.lang.String
getRequestURL()
java.lang.String
getScheme()
java.lang.String
getServerName()
int
getServerPort()
java.lang.String
getServletPath()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DefaultSavedRequest
public DefaultSavedRequest(javax.servlet.http.HttpServletRequest request, PortResolver portResolver)
-
DefaultSavedRequest
public DefaultSavedRequest(javax.servlet.http.HttpServletRequest request, PortResolver portResolver, java.lang.String matchingRequestParameterName)
-
-
Method Detail
-
doesRequestMatch
public boolean doesRequestMatch(javax.servlet.http.HttpServletRequest request, PortResolver portResolver)
Determines if the current request matches theDefaultSavedRequest
.All URL arguments are considered but not cookies, locales, headers or parameters.
- Parameters:
request
- the actual request to be matched against this oneportResolver
- used to obtain the server port of the request- Returns:
- 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 interfaceSavedRequest
-
getRedirectUrl
public java.lang.String getRedirectUrl()
Indicates the URL that the user agent used for this request.- Specified by:
getRedirectUrl
in interfaceSavedRequest
- Returns:
- the full URL of this request
-
getHeaderNames
public java.util.Collection<java.lang.String> getHeaderNames()
- Specified by:
getHeaderNames
in interfaceSavedRequest
-
getHeaderValues
public java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
- Specified by:
getHeaderValues
in interfaceSavedRequest
-
getLocales
public java.util.List<java.util.Locale> getLocales()
- Specified by:
getLocales
in interfaceSavedRequest
-
getMethod
public java.lang.String getMethod()
- Specified by:
getMethod
in interfaceSavedRequest
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
- Specified by:
getParameterMap
in interfaceSavedRequest
-
getParameterNames
public java.util.Collection<java.lang.String> getParameterNames()
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- Specified by:
getParameterValues
in interfaceSavedRequest
-
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()
- Overrides:
toString
in classjava.lang.Object
-
-