• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

struts

 
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
 
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*
 
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 ]
 
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 ]
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic