Results 1 to 4 of 4

Thread: user redirected instead of internally forwarded?

  1. #1
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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....
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default

    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. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •