In section 188.8.131.52 of the Spring manual, it advises against creating instances of RedirectView directly in the controller like this:
and suggests instead to use something like the following:
View redirectView = new RedirectView("http://example.org");
return new ModelAndView(redirectView);
(Ideally, the URL should be injected into the controller, rather than a hard-coded String literal, as above). However, one advantage of the first approach is that I can easily customise the redirection, for example by calling one of the following methods
return new ModelAndView("redirect:http://example.org");
Is it possible to perform the same customisation when using the second (recommended) approach?
Thanks in advance,