How about storing a flag in the session for the servlet that will be gaining
the focus.  Inside of either to doGet or DoPost method, have it check
(initially) the status of the flag in the session and if the flag is set,
revert to some error page.  Then, in the page BEFORE the one which has the
submit button on it, reset the session flag.  That way, the servlet will
know if the user has clicked the button more than once since the session can
only get set the flag the first time.  This is the way we trap for the
multiple-submit button problem.  You could also handle this at the
application level, but it'd be more wacky (ie:  you could have a static
variable that contained a handle to the user and the page you wanted to trap
on and then have the servlet look at the flag in the app before doing
anything.  This would trap for multiple browsers hitting the same page as
well).



                                                        Erik Sahl
                                                        [EMAIL PROTECTED]



> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
> Sent: Monday, August 30, 1999 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: double click
>
>
> I created a button that would call a servlet.
>
> How can I prevent the user to double click the button that will
> call the servlet twice?
>
> Thanks.
>
>
> Jack
> [EMAIL PROTECTED]
> ====================================================
> Making Money: Click below.
> http://www.gotoworld.com/getpaid/default.asp?rid=1013102248
> ====================================================
>
> __________________________________________________________________
> _________
> 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

Reply via email to