Two Laptop Bag
The moose likes Struts and the fly likes Form submission in struts 1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Form submission in struts 1.2" Watch "Form submission in struts 1.2" New topic

Form submission in struts 1.2

rajesh v

Joined: Aug 01, 2008
Posts: 3
when i insert new data and submit the form the data is inserted into the database correctly, and i am able to view the data but when i refresh the browser the form is submitted again and i am getting the data which was inserted just before.
How can i prevent this?
Please help me...
Joe Ess

Joined: Oct 29, 2001
Posts: 9138

Please check your private messages here for an important message.

[How To Ask Questions On JavaRanch]
Jules Bach
Ranch Hand

Joined: Apr 28, 2008
Posts: 71
I am not sure how your code fits together..perhaps changing the scope to a request rather than session?
Kanchan Singh
Ranch Hand

Joined: Dec 27, 2007
Posts: 38
Try using tokens. This should solve your problem of resubmission on refresh.
rajesh v

Joined: Aug 01, 2008
Posts: 3
Hi Kanchan Singh ,
Can you please explain it with an example code.
thanks ,
I agree. Here's the link:
subject: Form submission in struts 1.2
It's not a secret anymore!