Redirect from one page to another in Spring MVC

0


If we want to perform redirection into the spring MVC web application then we can use the redirect keyword under ModelAndView class Object and define the path of the controller.

suppose you want to create a login form and implement redirection after successful login then also we should use a redirect.

redirect also use browser cookie because it will redirect the page after browser instruction.


we will use ModelAndView class to implement Redirection from one web page to another.

we will write a redirect method under Model and View

return new ModelAndView("redirect:dashboard.do");


This code should be written on the Controller classes method, especially on login and logout operation.






Tags

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)