I do a form submit in my first page, the form data is saved and returned in the next page as a result set. Now when I refresh the second page, the data is again saved in the database from the previous page. I could see that the onSubmit of the first page controller is being called again. How do I stop this. Because I already saved the data and I also have the result set in my command object on refresh i simply want to display the existing values.
Ok that worked great for me. Since its a dumb page after form submission, I dint have much to do, I did a redirect, and in the next page's controller I have overridden referenceData() method of the spring's SimpleFormController class which gets called repeatedly (no additonal code necessary here for this to work) but to let you know that this gets called on every refresh. I make sure I send the request attibutes that I need in my next page at the end of the onsubmit. And its working fine.
To help anyone who will search for this in future I have placed my code snippet.
In my page one on form submit:
In my page 2 do nothing, just F5 and you still have old data and no submit action takes place for the old page.
Thank you, everyone for your response and suggestion.