org.springframework.security.web.savedrequest
Class HttpSessionRequestCache

java.lang.Object
  extended by org.springframework.security.web.savedrequest.HttpSessionRequestCache
All Implemented Interfaces:
RequestCache

public class HttpSessionRequestCache
extends java.lang.Object
implements RequestCache

RequestCache which stores the SavedRequest in the HttpSession. The DefaultSavedRequest class is used as the implementation.

Since:
3.0

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
HttpSessionRequestCache()
           
 
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 currentRequest, javax.servlet.http.HttpServletResponse response)
          Returns the saved request, leaving it cached.
 void removeRequest(javax.servlet.http.HttpServletRequest currentRequest, javax.servlet.http.HttpServletResponse response)
          Removes the cached request.
 void saveRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Stores the current request, provided the configuration properties allow it.
 void setCreateSessionAllowed(boolean createSessionAllowed)
          If true, indicates that it is permitted to store the target URL and exception information in a new HttpSession (the default).
 void setJustUseSavedRequestOnGet(boolean justUseSavedRequestOnGet)
          If true, will only use DefaultSavedRequest to determine the target URL on successful authentication if the request that caused the authentication request was a GET.
 void setPortResolver(PortResolver portResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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

HttpSessionRequestCache

public HttpSessionRequestCache()
Method Detail

saveRequest

public void saveRequest(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
Stores the current request, provided the configuration properties allow it.

Specified by:
saveRequest in interface RequestCache
Parameters:
request - the request to be stored

getRequest

public SavedRequest getRequest(javax.servlet.http.HttpServletRequest currentRequest,
                               javax.servlet.http.HttpServletResponse response)
Description copied from interface: RequestCache
Returns the saved request, leaving it cached.

Specified by:
getRequest in interface RequestCache
Parameters:
currentRequest - the current request
Returns:
the saved request which was previously cached, or null if there is none.

removeRequest

public void removeRequest(javax.servlet.http.HttpServletRequest currentRequest,
                          javax.servlet.http.HttpServletResponse response)
Description copied from interface: RequestCache
Removes the cached request.

Specified by:
removeRequest in interface RequestCache
Parameters:
currentRequest - the current request, allowing access to the cache.

getMatchingRequest

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

Specified by:
getMatchingRequest in interface RequestCache
Returns:
the wrapped save request, if it matches the original, or null if there is no cached request or it doesn't match.

setJustUseSavedRequestOnGet

public void setJustUseSavedRequestOnGet(boolean justUseSavedRequestOnGet)
If true, will only use DefaultSavedRequest to determine the target URL on successful authentication if the request that caused the authentication request was a GET. Defaults to false.


setCreateSessionAllowed

public void setCreateSessionAllowed(boolean createSessionAllowed)
If true, indicates that it is permitted to store the target URL and exception information in a new HttpSession (the default). In situations where you do not wish to unnecessarily create HttpSessions - because the user agent will know the failed URL, such as with BASIC or Digest authentication - you may wish to set this property to false.


setPortResolver

public void setPortResolver(PortResolver portResolver)