Class DefaultSavedRequest
java.lang.Object
org.springframework.security.web.savedrequest.DefaultSavedRequest
- All Implemented Interfaces:
Serializable
,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:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultSavedRequest
(jakarta.servlet.http.HttpServletRequest request, PortResolver portResolver) DefaultSavedRequest
(jakarta.servlet.http.HttpServletRequest request, PortResolver portResolver, String matchingRequestParameterName) -
Method Summary
Modifier and TypeMethodDescriptionboolean
doesRequestMatch
(jakarta.servlet.http.HttpServletRequest request, PortResolver portResolver) Determines if the current request matches theDefaultSavedRequest
.List<jakarta.servlet.http.Cookie>
getHeaderValues
(String name) String[]
getParameterValues
(String name) Indicates the URL that the user agent used for this request.int
toString()
-
Field Details
-
logger
protected static final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
DefaultSavedRequest
public DefaultSavedRequest(jakarta.servlet.http.HttpServletRequest request, PortResolver portResolver) -
DefaultSavedRequest
public DefaultSavedRequest(jakarta.servlet.http.HttpServletRequest request, PortResolver portResolver, String matchingRequestParameterName)
-
-
Method Details
-
doesRequestMatch
public boolean doesRequestMatch(jakarta.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
-
getCookies
- Specified by:
getCookies
in interfaceSavedRequest
-
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
- Specified by:
getHeaderNames
in interfaceSavedRequest
-
getHeaderValues
- Specified by:
getHeaderValues
in interfaceSavedRequest
-
getLocales
- Specified by:
getLocales
in interfaceSavedRequest
-
getMethod
- Specified by:
getMethod
in interfaceSavedRequest
-
getParameterMap
- Specified by:
getParameterMap
in interfaceSavedRequest
-
getParameterNames
-
getParameterValues
- Specified by:
getParameterValues
in interfaceSavedRequest
-
getPathInfo
-
getQueryString
-
getRequestURI
-
getRequestURL
-
getScheme
-
getServerName
-
getServerPort
public int getServerPort() -
getServletPath
-
toString
-