there is a form which contains some fields and at the end there is submit button. so when we press the submit buttion the data will be entered into the database. here some times the user will be clicking the submit button twice or thrice(may be in a hurry or unfamiliar user).if it is the case the data will be entered twice or thrice.so there is a chance of duplicate data. so how to avoid this double clicks(in servlets).
One option is to, show a alert msg moment user clicks on the button, and asks for confirmation. This would ensure that, they would not click twice. Then if they confirm to submit, before submitting the form, disable the button. I think this is what most of the pages do.