Hi.
Someone please please provide a simple Synchronizer Token example to avoid duplicate form submission. I have searched a lot, only got example which uses some or the other Framework. I need the example in to implement only in servlet ie. without using any framework. Please help me out.
There are a few approaches. The easiest is to set an attribute in the session when you display the form and remove it when you receive the form. If the attribute isn't there to delete, it is a duplicate submission.
Two related patterns/techniques:
1) Use JavaScript to disable the form button so the user doesn't click twice. (useful if users have dialup)
2) Use Post Redirect Get pattern so user hitting refresh doesn't submit the form again