Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts

 
mantena vasu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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*
 
Periakaruppan Thiagarajan
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic