1

Im working with Spring Boot and Thymeleaf. I want to redirect user after submitting succesfully a submit form (page B) to the page from which the user came from (page A). The easiest case is case page A -> page B -> page A. I found several post already:

  1. Get the page that redirected you here, Spring MVC.

Author states that 3 solutions exist:

  1. Add a hidden form attribute which contains the current page.
  2. Use the referer request header to determine where the request came from.
  3. Submit the form through ajax so that you stay on the current page.

Are there more modern approaches for this problem in thymeleaf + spring? I came across Spring Webflow but that seems overkill for my problem and outdated.

Thanks in advance!

0 Answers0