org.xwiki.container.servlet.filters
Class SavedRequestManager

java.lang.Object
  extended by org.xwiki.container.servlet.filters.SavedRequestManager

public final class SavedRequestManager
extends java.lang.Object

Allows to save a request and restore it later from the stored request identifier (SRID).

Since:
2.5M1
Version:
$Id$

Nested Class Summary
static class SavedRequestManager.SavedRequest
          Saved request data.
 
Method Summary
static java.lang.String getOriginalUrl(javax.servlet.http.HttpServletRequest request)
          Retrieves the original URL requested before a detour.
static java.lang.String getSavedRequestIdentifier()
           
static java.lang.String getSavedRequestKey()
           
static java.lang.String saveRequest(javax.servlet.http.HttpServletRequest request)
          Saves the data from a request and stores it in the current session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSavedRequestIdentifier

public static java.lang.String getSavedRequestIdentifier()
Returns:
the SAVED_REQUESTS_IDENTIFIER

getSavedRequestKey

public static java.lang.String getSavedRequestKey()
Returns:
the SAVED_REQUESTS_KEY

saveRequest

public static java.lang.String saveRequest(javax.servlet.http.HttpServletRequest request)
Saves the data from a request and stores it in the current session. This method is not thread safe, and does not guarantee that saved requests are not overwritten, but given that this should only happen sparingly, and that each client uses his own session to save this kind of information, this is not a real issue.

Parameters:
request - the request to save
Returns:
the identifier of the saved request

getOriginalUrl

public static java.lang.String getOriginalUrl(javax.servlet.http.HttpServletRequest request)
Retrieves the original URL requested before a detour. This method returns something different from null only when there's a srid parameter in the current request, indicating that there was another request which data was saved, related to the current request.

Parameters:
request - the current request
Returns:
the original requested URL that triggered a detour, or null if there isn't any original request information


Copyright © 2004-2011 XWiki. All Rights Reserved.