Glory Tips About How To Avoid Double Submission In Struts
![Struts 2 - The Form Tags](https://www.tutorialspoint.com/struts_2/images/helloworldstruts5.jpg)
I am using dynaactionform in struts, i have problem related to same data submitted two times, i have one jsp page ,work of that jsp page is to search data and shows.
How to avoid double submission in struts. These problems can be avoided by the special feature provided by struts called token. When the jsp is rendered, struts inserts the token as a hidden field. Struts2 has a built in mechanism for stopping double form submission that works on the server side instead of the client.
You may need to add the tokeninterceptor if its not on the. To avoid duplicate form submission problem struts provide 'struts token' concept. When the user cliks on ‘back’ button of the browser and clicks on ‘submit’ again.
Duplicate form submissions can occur in many ways. The duplicate form submission occurs. When the form is rendered, the struts html:form tag generates a hidden field named org.apache.struts.action.token.
When the user refreshes the form page again which submits the form. (99% candidates get this question in round 3 and 5). Struts will generate a unique value (the token) and keep it in the session context.
There are many scenarios where we face duplicate submission problem like, using refresh button; Any other way get the token and validate or other possible way to prevent the dobule submission? How can i prevent double submission?
Interview question for technical lead.how to prevent double submit in struts? If storefront is smart enough, it will recognize duplicate submissions and handle it graciously without charging you twice. Savetoken generates a unique token and saves it in the session under the key org.apache.struts.action.token.
When the user clicks the ‘submit’ button quickly twice without patience.