This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 63349
    
  70

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prevent Duplicate Post on Refresh to Database
 
It's not a secret anymore!