File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Prevent Duplicate Post on Refresh to Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Prevent Duplicate Post on Refresh to Database" Watch "Prevent Duplicate Post on Refresh to Database" New topic
Author

Prevent Duplicate Post on Refresh to Database

Joe Mizrahi
Greenhorn

Joined: Jun 14, 2006
Posts: 1
I have two JSP pages, the first allows the user to enter data and submit to a handler page that does the processing, posts the data to the database and re-displays a confirmation of the data entered.

The issue is that if a user "refreshes" the handler page through the browser... the data gets posted to the DB again....

Is there any methodology to prevent this from happening in this context.

Thanks !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Yes. Please read this article and pay particular attention to the PRG pattern.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: Prevent Duplicate Post on Refresh to Database