Class NullRequestCache
java.lang.Object
org.springframework.security.web.savedrequest.NullRequestCache
- All Implemented Interfaces:
RequestCache
Null implementation of RequestCache. Typically used when creation of a session
is not desired.
- Since:
- 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.servlet.http.HttpServletRequestgetMatchingRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Returns a wrapper around the saved request, if it matches the current request.getRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Returns the saved request, leaving it cached.voidremoveRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Removes the cached request.voidsaveRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Caches the current request for later retrieval, once authentication has taken place.
-
Constructor Details
-
NullRequestCache
public NullRequestCache()
-
-
Method Details
-
getRequest
public SavedRequest getRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:RequestCacheReturns the saved request, leaving it cached.- Specified by:
getRequestin interfaceRequestCache- Parameters:
request- the current request- Returns:
- the saved request which was previously cached, or null if there is none.
-
removeRequest
public void removeRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:RequestCacheRemoves the cached request.- Specified by:
removeRequestin interfaceRequestCache- Parameters:
request- the current request, allowing access to the cache.
-
saveRequest
public void saveRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:RequestCacheCaches the current request for later retrieval, once authentication has taken place. Used by ExceptionTranslationFilter.- Specified by:
saveRequestin interfaceRequestCache- Parameters:
request- the request to be stored
-
getMatchingRequest
public jakarta.servlet.http.HttpServletRequest getMatchingRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:RequestCacheReturns a wrapper around the saved request, if it matches the current request. The saved request should be removed from the cache.- Specified by:
getMatchingRequestin interfaceRequestCache- Returns:
- the wrapped save request, if it matches the original, or null if there is no cached request or it doesn't match.
-