Announcement Announcement Module
No announcement yet.
redirect: prefix and view resolver Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • redirect: prefix and view resolver

    I tried out the redirect: prefix support in Spring 1.1.2 and noticed that it does not resolve using logical view names but rather requires the resolved view name to be provided after the prefix.

    For example the following does not resolve the redirect success view to

    <bean id="addUserForm" class="">
    <property name="formView">
    <property name="successView">
    I understand that redirects can be used to redirect outside the current web app, but I think that a typical use case (atleast for me) is for redirect within the same app - like redirect after a form submission for reasons like double submit or redirect to the original form so that the user can, say, add another User.

    Could Spring support another prefix such as redirect_internal: that uses the native view resolver ?


  • #2
    Nevermind. I realized that the view resolver would resolved to something like addUser.jsp and not which would be what is required in a redirect.


    • #3
      I was just thinking the same thing, and your 2nd comment gave me the same lightbulb.

      Still, it seems rather "hardcoded" to have something like this in the controller:

      RedirectView rv = new RedirectView&#40;"/" + getSuccessView&#40;&#41; + ".htm"&#41;;
      Maybe some sort of "ExternalUrlResolver" would be appropriate?