Results 1 to 2 of 2

Thread: mvc: POST-REDIRECT-GET

  1. #1
    Join Date
    Aug 2004
    Posts
    12

    Default mvc: POST-REDIRECT-GET

    hi everyone,

    I'm using the spring MVC framework, and I'm wondering how to do this correctly. I have a website that uses an input form. When errors are found, that form has to be reloaded, when done the form shows a confirmation page showing mainly the same information.

    You could think of an order confirmation page in which the final details are entered, then when done submit is pressed and the order confirmation is shown.

    Now for parsing the orderform I use a SimpleFormController which nicely populates my model object and saves the order to the database and showing the confirmation view, however, the problem occurs when someone hits reload. The page would be resubmitted and another order placed (which is ofcourse not very desireable).

    Now an article on the serverside (http://www.theserverside.com/article...directAfterGet) said that the best solution was to post the data and redirect to the confirmation page. However, implementing this in spring MVC is not that simple. It requires me to overwrite the onSubmit. Besides that the model gets lost in the process and I'll have to request it again from the database. What would be a good way of handeling this posting pattern? Or are their alterantives or build in functions for this?

    Thanks,
    Vincent

  2. #2
    Join Date
    Aug 2004
    Location
    Whitehorse, YT, Canada
    Posts
    26

    Default

    I have a requirement to do the same thing: ask for data and then show a confirmation page. What I did was to have my controller extend AbstractWizardFormController, with page 0 being the form and page 1 being the confirmation page.

Similar Threads

  1. success messages - redirect after post
    By Keith Donald in forum Web
    Replies: 12
    Last Post: Jan 31st, 2010, 06:02 AM
  2. Redirect expose jsp path?
    By jackysee in forum Web
    Replies: 2
    Last Post: Jun 28th, 2005, 10:01 PM
  3. Redirect issue
    By neeraj_cmu in forum Web
    Replies: 4
    Last Post: Jun 7th, 2005, 09:38 AM
  4. redirect: prefix and view resolver
    By sjivan in forum Web
    Replies: 2
    Last Post: Dec 20th, 2004, 03:28 PM
  5. Spring FormController lacks POST -> REDIRECT support.
    By DaVinci79 in forum Architecture
    Replies: 2
    Last Post: Oct 21st, 2004, 03:24 AM

Posting Permissions

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