• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

duplicate form submission

 
RaviSingh Kumar
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am doing a small dumy project in struts. Facing some problem while submitting duplicate form.
1. There is a link "Add Record" which call the dispatchAction class with parameter as "add".
2. In dispatchAction class there is method add() in which i am doing some logic and then fwd the request to form as AddRecord.jsp page.
3. In add() method , added the code saveToken(request) in order to prevent duplicate form submission.
4. When the form is submitted, AddRecordAction is called. In this class we added isValidToken() method.

Problem is that when the form get submitted, the record get added in database and the URL shows as "http://xyz/action.do".When the page get refreshed , the data is not submitted to database.(i.e code is working fine).

But we submit the form with no data, error message is displayed on the form such as "fields marked with * are mandatory".Provide the data and then click on submit the form again. The date doesnot get added to database.

Please let me know how to proceed in this case.

Thanks in advance.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic