org.springframework.security.web.savedrequest
Interface RequestCache

All Known Implementing Classes:
HttpSessionRequestCache, NullRequestCache

public interface RequestCache

Implements "saved request" logic, allowing a single request to be retrieved and restarted after redirecting to an authentication mechanism.

Since:
3.0

Method Summary
 javax.servlet.http.HttpServletRequest getMatchingRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Returns a wrapper around the saved request, if it matches the current request.
 SavedRequest getRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Returns the saved request, leaving it cached.
 void removeRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Removes the cached request.
 void saveRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Caches the current request for later retrieval, once authentication has taken place.
 

Method Detail

saveRequest

void saveRequest(javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
Caches the current request for later retrieval, once authentication has taken place. Used by ExceptionTranslationFilter.

Parameters:
request - the request to be stored

getRequest

SavedRequest getRequest(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
Returns the saved request, leaving it cached.

Parameters:
request - the current request
Returns:
the saved request which was previously cached, or null if there is none.

getMatchingRequest

javax.servlet.http.HttpServletRequest getMatchingRequest(javax.servlet.http.HttpServletRequest request,
                                                         javax.servlet.http.HttpServletResponse response)
Returns a wrapper around the saved request, if it matches the current request. The saved request should be removed from the cache.

Parameters:
request -
response -
Returns:
the wrapped save request, if it matches the original, or null if there is no cached request or it doesn't match.

removeRequest

void removeRequest(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
Removes the cached request.

Parameters:
request - the current request, allowing access to the cache.