Why is my servlet called twice from a JavaScript button?

Bozidar Dangubic

Do you submit the form from the javascript? This can happen if you are calling the javascript function which does document.formName.submit() but the form itself also has an action attribute. Therefore, the form actually gets submitted twice. If you are submitting the page from the javascript, remove the action attribute from the form tag.