Hi
I have provided here simple steps needed to implement synchronizer token
pattern for the benefit of the readers.
Avoid duplicate form submission using Synchronizer Token Pattern in a STRUTS-based application
How to prevent a duplicate form submission on a
Struts JSP page. The duplicate form submission can occur for any of the following reasons:
(a) When a user clicks more than once on a submit button before the response is sent back
(b) When a client clicks on the Back button in the browser or simply refreshes the pages
(c) When the user accesses the web page by returning to a previously bookmarked page.
A typical STRUTS based implementation for a JSP page consists of the following components:
(a) DisplayAction executed before the JSP page �MyPage� is displayed.
(b) The JSP page �MyPage� containing form fields and a submit button
(c) SubmitAction executed as a result of clicking submit on MyPage JSP page.
Follow these simple steps:
Step 1: DisplayAction
Call saveToken(request): Puts the Token in the session. It also get puts in the request as a hidden form field by the Struts <html:form> tag if the Token is found in the session.
Pseudo-code:
Step 2: MyPage pseudo-code
Do a right click with your mouse in the browser and search for the hidden fields.
Step 3: SubmitAction
Thanks
-- Ravi
[ July 15, 2005: Message edited by: Ravindra Janapareddy ]