• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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*
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic