org.springframework.web.servlet.support

## Class SessionFlashMapManager

- java.lang.Object
- - org.springframework.web.servlet.support.AbstractFlashMapManager
  - - org.springframework.web.servlet.support.SessionFlashMapManager

- All Implemented Interfaces:
    FlashMapManager

      public class SessionFlashMapManager
      extends AbstractFlashMapManager

  Store and retrieve `FlashMap` instances to and from the HTTP session.
  Since:
    3.1.1
  Author:
    Rossen Stoyanchev, Juergen Hoeller

- - ### Field Summary

    - ### Fields inherited from class org.springframework.web.servlet.support.AbstractFlashMapManager

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionFlashMapManager()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `getFlashMapsMutex(HttpServletRequest request)` Exposes the best available session mutex.
    `protected List<FlashMap>` | `retrieveFlashMaps(HttpServletRequest request)` Retrieves saved FlashMap instances from the HTTP session, if any.
    `protected void` | `updateFlashMaps(List<FlashMap> flashMaps, HttpServletRequest request, HttpServletResponse response)` Saves the given FlashMap instances in the HTTP session.

    - ### Methods inherited from class org.springframework.web.servlet.support.AbstractFlashMapManager

      `getFlashMapTimeout, getUrlPathHelper, isFlashMapForRequest, retrieveAndUpdate, saveOutputFlashMap, setFlashMapTimeout, setUrlPathHelper`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SessionFlashMapManager

          public SessionFlashMapManager()

  - ### Method Detail

    - #### retrieveFlashMaps

          @Nullable
          protected List<FlashMap> retrieveFlashMaps(HttpServletRequest request)

      Retrieves saved FlashMap instances from the HTTP session, if any.
      Specified by:
        `retrieveFlashMaps` in class `AbstractFlashMapManager`
      Parameters:
        `request` - the current request
      Returns:
        a List with FlashMap instances, or `null` if none found

    - #### updateFlashMaps

          protected void updateFlashMaps(List<FlashMap> flashMaps,
                                         HttpServletRequest request,
                                         HttpServletResponse response)

      Saves the given FlashMap instances in the HTTP session.
      Specified by:
        `updateFlashMaps` in class `AbstractFlashMapManager`
      Parameters:
        `flashMaps` - a (potentially empty) list of FlashMap instances to save
        `request` - the current request
        `response` - the current response

    - #### getFlashMapsMutex

          protected Object getFlashMapsMutex(HttpServletRequest request)

      Exposes the best available session mutex.
      Overrides:
        `getFlashMapsMutex` in class `AbstractFlashMapManager`
      Parameters:
        `request` - the current request
      Returns:
        the mutex to use (may be `null` if none applicable)
      See Also:
        `WebUtils.getSessionMutex(javax.servlet.http.HttpSession)`, `HttpSessionMutexListener`