I'm having a big problem preventing double submission of an html form when either the user accidentally double clicks the submit button, or if an extra touchy mouse accidentally causes this. I've tried 2 things:
thing 2: in my jsp program I created a session variable to hold the time of the last update. I check this time on each update. If it has been less than 5 seconds since the previous update, I abort the update. However, same problem here. The 2nd click submits the form before the 1st submission has time to update the session variable. So, it doesn't see the timestamp of the 1st update.
This is a serious problem because I am inserting duplicate records into my database all the time.