|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.support.DefaultFlashMapManager
public class DefaultFlashMapManager
A default FlashMapManager
implementation that stores FlashMap
instances in the HTTP session.
Field Summary |
---|
Fields inherited from interface org.springframework.web.servlet.FlashMapManager |
---|
INPUT_FLASH_MAP_ATTRIBUTE, OUTPUT_FLASH_MAP_ATTRIBUTE |
Constructor Summary | |
---|---|
DefaultFlashMapManager()
|
Method Summary | |
---|---|
protected boolean |
isFlashMapForRequest(FlashMap flashMap,
HttpServletRequest request)
Whether the given FlashMap matches the current request. |
protected void |
onSaveFlashMap(FlashMap flashMap,
HttpServletRequest request)
Update a FlashMap before it is stored in the HTTP Session. |
void |
requestCompleted(HttpServletRequest request)
Start the expiration period of the "output" FlashMap save it in the underlying storage. |
void |
requestStarted(HttpServletRequest request)
Perform the following tasks unless the FlashMapManager.OUTPUT_FLASH_MAP_ATTRIBUTE
request attribute exists:
Find the "input" FlashMap, expose it under the request attribute
FlashMapManager.INPUT_FLASH_MAP_ATTRIBUTE , and remove it from underlying storage. |
protected List<FlashMap> |
retrieveFlashMaps(HttpServletRequest request,
boolean allowCreate)
Retrieve all FlashMap instances from the current HTTP session. |
void |
setFlashMapTimeout(int flashTimeout)
Set the amount of time in seconds after a FlashMap is saved
(at request completion) and before it expires. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFlashMapManager()
Method Detail |
---|
public void setFlashMapTimeout(int flashTimeout)
FlashMap
is saved
(at request completion) and before it expires.
The default value is 180 seconds.
public void requestStarted(HttpServletRequest request)
FlashMapManager.OUTPUT_FLASH_MAP_ATTRIBUTE
request attribute exists:
FlashMapManager.INPUT_FLASH_MAP_ATTRIBUTE
, and remove it from underlying storage.
FlashMapManager.OUTPUT_FLASH_MAP_ATTRIBUTE
.
An HTTP session is never created by this method.
requestStarted
in interface FlashMapManager
request
- the current requestprotected boolean isFlashMapForRequest(FlashMap flashMap, HttpServletRequest request)
protected List<FlashMap> retrieveFlashMaps(HttpServletRequest request, boolean allowCreate)
allowCreate
is "true" and no flash maps exist yet, a new list
is created and stored as a session attribute.
request
- the current requestallowCreate
- whether to create the session if necessary
null
assuming allowCreate
is "false".public void requestCompleted(HttpServletRequest request)
The "output" FlashMap should not be saved if it is empty or if it was not created by the current FlashMapManager instance.
An HTTP session is never created if the "output" FlashMap is empty.
requestCompleted
in interface FlashMapManager
request
- the current requestprotected void onSaveFlashMap(FlashMap flashMap, HttpServletRequest request)
The default implementation starts the expiration period and ensures the target request path is decoded and normalized if it is relative.
flashMap
- the flash map to be savedrequest
- the current request
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |