Redirect should be used to avoid double form POST submission: Redirected URL = test2?myModelAttribute=attributeVal We have to create and return an instance of RedirectView from the handler class M圜ontroller RedirectView handleTestRequest (Model model) RedirectView is the suggested way to perform URL redirection. Please check out our tutorials on basics of URL redirection and URL redirect in Java Servlet.
Other than 302 status code there are a number of other codes which can be used. The redirected URL can point to the same domain or to a different domain. The Browser re-submits the new 'Location' URL to the server. Unlike URL forward (which is entirely server internal redirect), URL redirect sends the redirect HTTP code (typically 302) to the client browser along with new 'Location' header. To redirect HTTP request to another URL we can inject to handler method and use the method: