I have a standardized hidden field that goes to the server with every
submission.
<input type="hidden" name="DupIdentity" value=x>
I have this hidden field in every page where updation is required.(But it
has got different value for every page)
Then I store this value in the session and check to see if it's duplicate.
Following is the snippet that's there in the beginning of the doGet/doPost
method
/*
Check out duplicacy(Multiple Submission)
*/
boolean duplicacy=false;
String FormValue="";
if(request.getParameter("DupIdentity")!=null){
FormValue=(sess.getValue("formName")==null?"":(String)sess.getValue("formNam
e"));
if(FormValue.equals(request.getParameter("DupIdentity")))
duplicacy=true;
sess.putValue("formName",request.getParameter("DupIdentity"));
}
Now we can use this boolean value where ever to decide about the multiple
submission.
Hope that it helps....
-----Original Message-----
From: Chin Cedric Sung Kit [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 01, 2000 12:04 AM
To: [EMAIL PROTECTED]
Subject: Re: [off-topic] prevent submit button hit twice?
mind to share with me, how do u handle this?
thanks.
ced
Anshul Dutta wrote:
> I handle this at the server end...
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Chin
> Cedric Sung Kit
> Sent: Friday, June 30, 2000 10:02 PM
> To: [EMAIL PROTECTED]
> Subject: [off-topic] prevent submit button hit twice?
>
> hi,
>
> this is off-topic. i would like to know is there anyway to prevent the
> user from hitting the submit button more than once? because if the user
> clicks twice or more, one or more duplicated data will be sent to the
> servlets; and duplicated data will be written into the database as
> well....
>
> is there anyway to prevent this?
>
> thanks
>
> regards,
> ced
>
>
___________________________________________________________________________
> 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
___________________________________________________________________________
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