Re: Maintaining form data across pages...
Thursday, January 31, 2002 04:57 PM
here's an example:
you have an HTML form. after it is filled out the user previews the results on a second JSP and then chooses to submit or edit the HTML form again. If the user submits, then he is forwarded to a confirmation page.
In order to process this you do:
1) cache ActionForm in session after form submission.
2) I pass my Customer bean to the preview page via request. I was able to construct a Customer bean by calling a toXXXX() method in my ActionForm (e.g. toCustomer).
3) on the confirmation page i query the database and return the results as a Customer bean passed via request. I also clean out session using removeAttribute().
I hope that helps...