Aug 15th, 2007, 11:13 AM
Form values are not saved if form validation fails
I have a Spring SimpleFormController with validation. When the user has validation errors, it correctly displays the error message. Then I enter the correct values and the form is submitted. It is a form/search type of thing so when submit it forwards to another controller to handle the display of those results. The results and the user form entry is saved in the session.
My problem is that if the user incorrectly enters the form, then they correctly do the submission, but hit the back button, then the popup comes up "The page you are trying to view contains POSTDATA that has expired from the cache". I hit OK but then the form only shows the entries that were made that were invalid, not the current correct entries from the recent submission.
If the form is entered correctly just one time and the back button is hit, then the popup does not come back.
I have overridden the formBackingObject function.
I am saving the user input in the session by using
Am I doing it incorrectly? How can I fix this problem?