ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Handling Multiple Submits
Subject:   The challenge is...
Date:   2003-04-09 18:16:54
From:   anonymous2
The Javascript is nice for folks who ACCIDENTALLY try to submit twice. The challenge, though, is to actually DO something with that second submit if it DOES go through (i.e., the user doesn't have javascript enabled, or by some other means maliciously and deliberately submits twice.)


The DO something I'm referring to is trying to JOIN the second submit to the first. Rather than slap the user's hand saying they posted twice (meanwhile, their fridge is being shipped, but they never received notification), actually respond to the second submit and make it appear as though it were the first.


I guess the most elegant solution to this is to lock the user's session at the VERY beginning of the request, and after all the WORK is done, prior to selecting a view, unlocking the session - then the view is selected based on the contents and state of the SESSION, not the request.