How can duplicate form submission be handled in Struts 2?

Answer

The problem of duplicate form submission arises when a user clicks the Submit button more than once before the response is sent back. This may result in inconsistent transactions and must be avoided. In Struts this problem can be handled by using the saveToken() and isTokenValid() methods of Action class. saveToken() method creates a token (a unique string) and saves that in the user’s current session, while isTokenValid() checks if the token stored in the user’s current session is the same as that was passed as the request parameter.

All struts2 Questions

Ask your interview questions on struts2

Write Your comment or Questions if you want the answers on struts2 from struts2 Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---