Top Description Methods
org.springframework.web.servlet

public Interface FlashMapManager

Known Direct Implementers
org.springframework.web.servlet.support.AbstractFlashMapManager
Imports
jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, org.springframework.lang.Nullable

A strategy interface for retrieving and saving FlashMap instances. See FlashMap for a general overview of flash attributes.
Author
Rossen Stoyanchev
Since
3.1
See Also
FlashMap

Method Summary

Modifier and TypeMethod and Description
public FlashMap

Returns:

a FlashMap matching the current request or null
retrieveAndUpdate
(HttpServletRequest
the current request
request
,
HttpServletResponse
the current response
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.

public void
saveOutputFlashMap(FlashMap
the FlashMap to save
flashMap
,
HttpServletRequest
the current request
request
,
HttpServletResponse
the current response
response
)

Save the given FlashMap, in some underlying storage and set the start of its expiration period.

Method Detail

retrieveAndUpdateback to summary
public FlashMap retrieveAndUpdate(HttpServletRequest request, 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, which is invoked only when there are flash attributes to be saved - i.e. before a redirect.

Parameters
request:HttpServletRequest

the current request

response:HttpServletResponse

the current response

Returns:FlashMap

a FlashMap matching the current request or null

Annotations
@Nullable
saveOutputFlashMapback to summary
public void saveOutputFlashMap(FlashMap flashMap, HttpServletRequest request, 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:FlashMap

the FlashMap to save

request:HttpServletRequest

the current request

response:HttpServletResponse

the current response