Ok, so it seems like that whole
ModelAndView("redirect:"+url);
thing is just a builtin shortcut, I assume the view in question is a RedirectView()
According to
http://jira.springframework.org/browse/SPR-5468 it seems like sometime soonish I should be able to write
ModelAndView redirectModelAndView = new ModelAndView();
RedirectView redirectView = new RedirectView(brandService.getBaseHref(request));
redirectView.setResponseStatus(301)
return redirectModelAndView;
but not yet.
http://forum.springsource.org/archive/index.php/t-16370.html tells me I should be able to extend RedirectView and override sendRedirect with:
response.setStatus(301);
response.setHeader("Location", response.encodeRedirectURL(targetUrl));
but for now my lead just says
response.setStatus(301);
response.setHeader("Location", brandService.getBaseHref(request));
response.setHeader("Connection", "close");
return null;
and Spring will take that null ModelAndView and just let the other stuff pass through.
Thoughts?