When redirecting to an (external) URL, a
RedirectView
may be used for the ModelAndView
that is returned from the handler method, for example:
RedirectView redirectView = new RedirectView("http://www.my-website.com/"); redirectView.setStatusCode(HttpStatus.MOVED_PERMANENTLY); return new ModelAndView(redirectView);