its even easier than that. put this into any button that is used to submit a form request.
onclick="this.disabled=true;form.submit();" we used to call this coffeefingering. -Tim -----Original Message----- From: David Mossakowski [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 6:07 PM To: [EMAIL PROTECTED] Subject: Re: SingleThreadModel and Synchronization. It's not that difficult. You need to create an action or event id of some sorts and have it as a hidden field in the form. After submitting the form you 'remember' the action event id and if you receive a form request with the same id you know that the user clicked the button second time. As a response you can cancel the last action and try resubmitting the request. Or if you do the action in a separate thread then just ignore the subsequent clicks until the action is completed. d. Nic Ferrier wrote: > Diego Sabaris <[EMAIL PROTECTED]> writes: > > >>Sure! How can I prevent the user to perform a second request without waiting >>the first one response? >>Some users have not patience and I'd want not to process the request >>simultaneously. > > > > Ah... that's really difficult to do. > > The best way to avoid this problem is to code your app so the user's > can't hurt anything if they bang multiple selects. That's sometimes > pretty difficult but it is possible. > > The way to achieve it is to gate or pool all your operational > objects. Pooled db connections, for example, make it possible for > users to do many queries at once. > > If you're doing something user specific (like a user specific database > connection or a POP3 connection or something) or something transactional > then you generally need a lock on the resource to prevent the user > doing it twice. > > My last email described roughly the sort of thing you need to do. > > > Of course, the best way to avoid this is to have an application that > is so simple that it's fast enough the user's never double enter. > > > Nic > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > > -- David Mossakowski [EMAIL PROTECTED] Instinet Corporation 212.310.7275 **************************************************************************** *** <<Disclaimer>> This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL or both. This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return mail and permanently deleting the copy you received. Thank you. **************************************************************************** *** ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
