|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter
public class SavedRequestRestorerFilter
A filter that allows requests to be saved and reused later. For example when the current request contains an expired authentication token, and the authorization module redirects to the login page, all the information sent by the client would be lost; this filter allows to save all that information, and after a successful login, injects the saved data in the new request.
The saved data is used as a fallback for the new request, meaning that a parameter value is first searched in the new request, and only if not found it is searched in the saved request. Only the request parameters are stored, along with the request URL needed to verify that the request is reused only in a compatible future request. Multiple requests can be stored, each one identified by a distinct ID. A request is restored only if a valid ID was provided in the new URL, and if the new URL matches the URL of the saved request (except the query string). A saved session is deleted after it is restored, so it cannot be reused more than once.
Request data is stored in the current HTTP session, in order to provide a safe temporary storage. The data is only as safe as a session is, and it will not be available after the session is invalidated. Another consequence is that only HTTP requests are saved.
| Nested Class Summary | |
|---|---|
static class |
SavedRequestRestorerFilter.SavedRequestWrapper
Request Wrapper that inserts data from a previous request into the current request. |
| Constructor Summary | |
|---|---|
SavedRequestRestorerFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
protected SavedRequestManager.SavedRequest |
getSavedRequest(javax.servlet.http.HttpServletRequest request)
If this request specifies a saved request (using the srid paramter) and the URL matches the one of the saved request, return the SavedRequest and remove it from the session. |
void |
init(javax.servlet.FilterConfig filterConfig)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SavedRequestRestorerFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig filterConfig)
init in interface javax.servlet.FilterFilter.init(javax.servlet.FilterConfig)
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletExceptionFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
javax.servlet.FilterChain)public void destroy()
destroy in interface javax.servlet.FilterFilter.destroy()protected SavedRequestManager.SavedRequest getSavedRequest(javax.servlet.http.HttpServletRequest request)
request - the current request
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||