Redirect in one of the previous articles.
Http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-flash-attributes
Flash attributes provides a way for a request to save attribute for other requests. This is common when redirecting--for example, post/redirect/get pattern. Flash attributes will be temporarily saved- usually saved in session before redirection.
For the support of Flash attributes, Spring MVC has two main abstractions. The flashmap is used for hold flash attributes,Flashmapmanager for storing, acquiring, and managing Flashmap instances.
Flash attribute support is always open and does not need to be explicitly enabled. Each request has an "input" flashmap-the attributes (if any) that came with the previous request, and an "output" flashmap--with the attributes that will be stored for use with the next request. Two Flashmap instances can be accessed anywhere using the static methods in the Requestcontextutils.
Controllers that use annotations usually do not need to use flashmap directly. Instead, @RequestMapping method can accept a parameter of type redirectattributes and use it to add flash attributes for redirection. Flash attributes added via redirectattributes are automatically propagated to the "output" flashmap. Similarly, after redirection, the attributes from the "input" Flashmap is automatically added to the controller's model to serve the target URL.
Match request to Flash attributes
The concept of flash attributes exists in many other web frameworks and is proven to cause concurrency problems. This is because, by definition, flash attributes is stored as the deadline to the next request. However, the next request may not be the intended recipient, but another asynchronous request (for example, a polling or resource request), in which case the flash attributes will be removed prematurely.
To reduce the likelihood of this problem, Redirectview automatically adds a stamp to the Flashmap instance-path and query parameters with the target redirect URL. The default Flashmapmanager matches the request and the information-when looking for the "input" flashmap.
This does not completely eliminate the likelihood of concurrency problems, but it can be largely reduced. Therefore, flash attributes, recommended mainly in the redirection scene use!!!
Spring 4 Official Document Learning (11) Web MVC Framework Flash Attributes