Flash attribute

In a normal Spring MVC application, every form submitted POSTs the form data to the server; a normal Spring Controller retrieves the data from those forms from the request and processes it further. Once the operation is successful, the user is forwarded to another page showing a message that the operation was a success.

Traditionally, if we handle this scenario via the POST/Forward/GET pattern, then it may sometimes cause multiple form submission issues. The user might press F5 and the same form will be submitted again. To resolve this issue, the POST/Redirect/GET pattern is used in many web applications. Once the user's form is submitted successfully, we redirect the request to another success page instead of forwarding it. This ...

Get Spring MVC Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.