• 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

Refresh Page

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When Submit a Form and while submit is working ,press the Refresh , what will happen in Struts ?
 
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mahi Ranga wrote:When Submit a Form and while submit is working ,press the Refresh , what will happen in Struts ?



1) Depends upon browser
2) Usually re-submits the request
3) Check on Google
4) Try yourself to see various scenarios
 
Mahi Ranga
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When Submit a Form and while submit is working ,press the Refresh , that it will go same request and insert duplicate records,but i want validation of button.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your case, if the request is inserting some data and you want to prevent duplicate insertion then implement the validate method in your action form and verify if the data is already present in the db.
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or better use Post/Redirect/Get Design pattern
 
Mahi Ranga
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I heard Tokens for applying to buttons.can you please explain Tokens.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ranga,
preventing dublicate form submission you need to configure token interceptor. please read the insturctions in below url.


struts2tokeninterceptor
 
Mahi Ranga
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sir,
thanks for reply,but by Using tokens(isValidateToken()) method we can resolve that problem,but i want sample example.Please provide sample example.
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hope you could have taken the trouble to search "Duplicate Form Submissions" on Google.

Here are the first two results..

http://www.netmechanic.com/news/vol5/html_no16.htm

https://coderanch.com/t/51602/Struts/Duplicate-form-submission-Synchronizer-Token
 
Mahi Ranga
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much sir.
 
reply
    Bookmark Topic Watch Topic
  • New Topic