Class SavedRequestAwareProcessor
- java.lang.Object
-
- org.craftercms.security.processors.impl.SavedRequestAwareProcessor
-
- All Implemented Interfaces:
RequestSecurityProcessor
public class SavedRequestAwareProcessor extends Object implements RequestSecurityProcessor
UsesRequestCache
to reconstitute a previously saved request (if there's one). This processor is used primarily when a user is redirected to the login page because authentication is required, and the the user is redirected back to the previous page.- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
logger
protected org.springframework.security.web.savedrequest.RequestCache
requestCache
-
Constructor Summary
Constructors Constructor Description SavedRequestAwareProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain)
Checks if there's a request in the request cache (which means that a previous request was cached).void
setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
-
-
-
Method Detail
-
setRequestCache
public void setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
-
processRequest
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception
Checks if there's a request in the request cache (which means that a previous request was cached). If there's one, the request cache creates a new request by merging the saved request with the current request. The new request is used through the rest of the processor chain.- Specified by:
processRequest
in interfaceRequestSecurityProcessor
- Parameters:
context
- the context which holds the current request and responseprocessorChain
- the processor chain, used to call the next processor- Throws:
Exception
-
-