org.xwiki.container.servlet.filters
Class SavedRequestManager

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

public final class SavedRequestManager
extends 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 String getOriginalUrl(javax.servlet.http.HttpServletRequest request)
          Retrieves the original URL requested before a detour.
static String getSavedRequestIdentifier()
           
static String getSavedRequestKey()
           
static 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 String getSavedRequestIdentifier()
Returns:
the SAVED_REQUESTS_IDENTIFIER

getSavedRequestKey

public static String getSavedRequestKey()
Returns:
the SAVED_REQUESTS_KEY

saveRequest

public static 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 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-2012 XWiki. All Rights Reserved.