Class SavedRequestManager
- java.lang.Object
-
- 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: fe7206aa864c24c03c09e2b1813e6efa04f510b3 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SavedRequestManager.SavedRequest
Saved request data.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 fromnull
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
-
-