Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to prevent double submission?

 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have a school list site and its developed under struts framework.

in my application, I have created school list and stored them into database.
when I clicked on the back button (browser back), and once again the application is saving the same data. so its a bad approach. how can I prevent storing

the url after I saved : - http://localhost:9080/SchoolListBuilder/saveSchoolList.do
and immediately the success view is showing correctly. when i click on the back button the warning page is displaying "Warning: Page has Expired" and i refresh that page, once again the data is storing with the same data into database.

what type of approach i need to follow to prevent double submission?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this article, and pay particular attention to the P-R-G pattern.
 
mahmoud allam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use tokens it's simple ;check this link http://www.learntechnology.net/content/struts/struts_token.jsp
 
Dipali Selukar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The duplicate form submission occurs

-When a user clicks the Submit button more than once before the response is sent back or
- When a client accesses a view by returning to a previously bookmarked page.
Read More..........
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The code above is complete example for resubmit of button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic