Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts" Watch "struts" New topic
Author

struts

mantena vasu
Greenhorn

Joined: Dec 29, 2005
Posts: 1
Hi, i am new to struts. I submit the FORM from showdetails.jsp page n again i want to come back to the same page (i.e showdetails.jsp). But now when i refresh the page, again the action class (from addressbar: ...\abc.do) is calling and inserting the same record into the database.

Can anybody help me plzz

Tnks in Advance...

- Vasu
Aaron Ting
Ranch Hand

Joined: Dec 13, 2005
Posts: 78
Originally posted by mantena vasu:
Hi, i am new to struts. I submit the FORM from showdetails.jsp page n again i want to come back to the same page (i.e showdetails.jsp). But now when i refresh the page, again the action class (from addressbar: ...\abc.do) is calling and inserting the same record into the database.

Can anybody help me plzz

Tnks in Advance...

- Vasu


Greetings Vasu,

You might want to check from your struts-config.xml file whether the scope of your action is either "request" or "session"...

*Cheers*


If you can't convince them, confuse them!
Periakaruppan Thiagarajan
Ranch Hand

Joined: Jul 26, 2005
Posts: 65
In Struts, refreshing the page is nothing but doing the previous request again. You can use tokens provided by struts to prevent double submission.
[ December 29, 2005: Message edited by: Periakaruppan Thiagarajan ]
Atchuta Penmatsa
Greenhorn

Joined: Feb 15, 2002
Posts: 6
Hi,
Struts has a feature to prevent "duplicate form Submission".
Use setToken(), checkToken() and resetToken() methods of Action class to control this behavior.

Cheers,
Atchuta
[ December 29, 2005: Message edited by: Atchuta Penmatsa ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts
 
Similar Threads
How to get the servlet's requesting page ?
gatting the details of the user
htaccess and mod_rewrite issue
Srikanth Shenoy: Bookmarking in Struts
Need help in learning struts