Languages
[Edit]
EN

Java - spring attribute redirection

13 points
Created by:
Creg
9600

In Spring Freamwork it is possible to make attribute redirection in following way.

1. RedirectAttributes class examples

Edit

1.1. redirect: prefix

Edit

RedirectionExampleController.java file:

 Running:

  1. Run server, e.g. on localhost:8080
  2. Open in browser following link: http://localhost:8080/redirect-to-my-final-page

Result:

Note: web page should be redirected to http://localhost:8080/my-final-page.

1.2. ModelAndView class

Edit

In this section alternative redirection approach with ModelAndView class is presented.

RedirectionExampleController.java file:

1.3. RedirectView class

Edit

In this section alternative redirection approach with RedirectView class is presented.

RedirectionExampleController.java file:

2. References

Edit
  1. Redirecting - Spring Docs 
  2. RedirectAttributes Class - Spring Docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join