If the user clicks the Submit button multiple times in rapid succession, multiple (duplicate)entries are inserted in the DB. How to avoid this?
Joined: Jan 29, 2002
Joined: Nov 27, 2001
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Joined: Jun 25, 2001
Hi, To prevent website visitors resubmitting the same form data multiple times (by clicking the submit button on a web form, then the back button in the web browser), one can use a no-cache meta tag. Insert the following HTML tag into the header part of the form template file: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> Hope this is useful stuff for u
Joined: Jan 02, 2002
Check out hte sychronizer token pattern published in "core j2ee patterns" Basically what you do is, you give every form a unique ID, and a form can be submitted only once with the same ID. so teh subsequent submitions fail. The mechnics is: generate the ID, put it in the form as a hidden field, store the ID in session. When the form is submitted check if the ID in request matches with the ID in session. If they match, its a valid (first time) submition, remove the id from session and process the request If they do not match, the submition is invalid. If it is not clear and you don't have access to the book, feel free to ask questions.
tobe bondhu nouka bherao<br />shonabo gaan aj shara raat