Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Page refresh is forcing form re-submit

843833Oct 31 2001 — edited Nov 10 2001
Help!
My JSP contains a form with a POST action (that calls a servlet). The POST causes the form data to be saved to a database. Simple. However, if the user hits the browser's Refresh button, the form data gets re-submitted, thus causing another row to be added.
I've tried setting flags in HIDDEN form items, but the very same form data is re-posted each time the refresh button is hit, so I can't really detect if the user has hit the Submit button, or hit the Refresh button.
Does anyone have a nice solution (in code) to this? It would really help.

Regards,

Andy Deighton
Green Room GB Ltd
www.greenroomgb.com
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2001
Added on Oct 31 2001
9 comments
965 views