Package 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
Description
`SessionFlashMapManager()`

## Method Summary

Modifier and Type
Method
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 Details

### SessionFlashMapManager

public SessionFlashMapManager()

## Method Details

### 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(jakarta.servlet.http.HttpSession)`
  - `HttpSessionMutexListener`