Spring redirect: prefix issue

Posted by Javi on Stack Overflow See other posts from Stack Overflow or by Javi
Published on 2010-04-13T11:53:43Z Indexed on 2010/04/13 22:53 UTC
Read the original article Hit count: 465

Filed under:
|
|

Hello,

I have an application which uses Spring 3. I have a view resolver which builds my views based on a String. So in my controllers I have methods like this one.

@RequestMapping(...)
public String method(){
  //Some proccessing
  return "tiles:tileName"
}

I need to return a RedirectView to solve the duplicate submission due to updating the page in the browser, so I have thought to use Spring redirect: prefix. The problem is that it only redirects when I user a URL alter the prefix (not with a name a resolver can understand). I wanted to do something like this:

@RequestMapping(...)
public String method(){
  //Some proccessing
  return "redirect:tiles:tileName"
}

Is there any way to use RedirectView with the String (the resolvable view name) I get from the every controller method?

Thanks

© Stack Overflow or respective owner

Related posts about spring

Related posts about spring-mvc