Spring Framework

org.springframework.web.servlet
Interface FlashMapManager

All Known Implementing Classes:
AbstractFlashMapManager, SessionFlashMapManager

public interface FlashMapManager

A strategy interface for retrieving and saving FlashMap instances. See FlashMap for a general overview of flash attributes.

Since:
3.1
Author:
Rossen Stoyanchev
See Also:
FlashMap

Method Summary
 FlashMap retrieveAndUpdate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Find a FlashMap saved by a previous request that matches to the current request, remove it from underlying storage, and also remove other expired FlashMap instances.
 void saveOutputFlashMap(FlashMap flashMap, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Save the given FlashMap, in some underlying storage and set the start of its expiration period.
 

Method Detail

retrieveAndUpdate

FlashMap retrieveAndUpdate(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
Find a FlashMap saved by a previous request that matches to the current request, remove it from underlying storage, and also remove other expired FlashMap instances.

This method is invoked in the beginning of every request in contrast to saveOutputFlashMap(org.springframework.web.servlet.FlashMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), which is invoked only when there are flash attributes to be saved - i.e. before a redirect.

Parameters:
request - the current request
response - the current response
Returns:
a FlashMap matching the current request or null

saveOutputFlashMap

void saveOutputFlashMap(FlashMap flashMap,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
Save the given FlashMap, in some underlying storage and set the start of its expiration period.

Note: Invoke this method prior to a redirect in order to allow saving the FlashMap in the HTTP session or in a response cookie before the response is committed.

Parameters:
flashMap - the FlashMap to save
request - the current request
response - the current response

Spring Framework