org.springframework.web.servlet
Interface FlashMapManager

All Known Implementing Classes:
DefaultFlashMapManager

public interface FlashMapManager

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

A FlashMapManager is invoked at the beginning and at the end of requests. For each request it retrieves an "input" FlashMap with attributes passed from a previous request (if any) and creates an "output" FlashMap with attributes to pass to a subsequent request. "Input" and "output" FlashMap instances are exposed as request attributes and are accessible via methods in org.springframework.web.servlet.support.RequestContextUtils.

Annotated controllers will usually not use this FlashMap directly. See org.springframework.web.servlet.mvc.support.RedirectAttributes.

Since:
3.1
Author:
Rossen Stoyanchev
See Also:
FlashMap

Field Summary
static String INPUT_FLASH_MAP_ATTRIBUTE
          Name of request attribute that holds a read-only Map<String, Object> with "input" flash attributes if any.
static String OUTPUT_FLASH_MAP_ATTRIBUTE
          Name of request attribute that holds the "output" FlashMap with attributes to save for a subsequent request.
 
Method Summary
 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 OUTPUT_FLASH_MAP_ATTRIBUTE request attribute exists: Find the "input" FlashMap, expose it under the request attribute INPUT_FLASH_MAP_ATTRIBUTE, and remove it from underlying storage.
 

Field Detail

INPUT_FLASH_MAP_ATTRIBUTE

static final String INPUT_FLASH_MAP_ATTRIBUTE
Name of request attribute that holds a read-only Map<String, Object> with "input" flash attributes if any.

See Also:
RequestContextUtils.getInputFlashMap(HttpServletRequest)

OUTPUT_FLASH_MAP_ATTRIBUTE

static final String OUTPUT_FLASH_MAP_ATTRIBUTE
Name of request attribute that holds the "output" FlashMap with attributes to save for a subsequent request.

See Also:
RequestContextUtils.getOutputFlashMap(HttpServletRequest)
Method Detail

requestStarted

void requestStarted(HttpServletRequest request)
Perform the following tasks unless the OUTPUT_FLASH_MAP_ATTRIBUTE request attribute exists:
  1. Find the "input" FlashMap, expose it under the request attribute INPUT_FLASH_MAP_ATTRIBUTE, and remove it from underlying storage.
  2. Create the "output" FlashMap and expose it under the request attribute OUTPUT_FLASH_MAP_ATTRIBUTE.
  3. Clean expired FlashMap instances.

Parameters:
request - the current request

requestCompleted

void requestCompleted(HttpServletRequest request)
Start the expiration period of the "output" FlashMap save it in the underlying storage.

The "output" FlashMap should not be saved if it is empty or if it was not created by the current FlashMapManager instance.

Parameters:
request - the current request