Announcement Announcement Module
No announcement yet.
user redirected instead of internally forwarded? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • user redirected instead of internally forwarded?

    Im reading the book "building spring 2 enterprise applications" and i'm at the section regarding how to implement onSubmit(). it says:
    After every form submission, the user should be redirected, not internally forwarded, to the success
    page. This is a very important user experience and data-integrity concern, so always redirect a user
    after an HTTP POST request.
    my question is what isthe difference between redirecting to the success page and "internally forwarding"? and why is it dangerous to internally foward? thanks.

  • #2
    Ever seen those irritating popups when you press the back button, that is what you get when you don't do a redirect after post. If you internally forward do back you will get a popup saying 'this page contains post data, do you want to re submit' (or something along that lines).

    No imagine you are submitting an order and you do back and again submit an order... You end up with 2 shipments delivered....


    • #3
      if i do setSuccessView(redirect:success) it will look for a controller mapped to /success right? is it possible to just go directly to a jsp or is that only possible with an "internal forward"?


      • #4
        It depends...

        If your JSP's are directly accesible you can, however this isn't adviced.

        I suggest you read the reference guide about redirection and take a look at the UrlFilenameViewController...