I am facing a peculiar problem in my web application. Whenever I click on a button in a jsp, the web container is invoking the servlet filter twice. The entire flow is thus, getting executed twice. The action to be performed is insert a row in a table in database.
Due to the above problem, each time I submit a form, instead of one entry, two entries are made in the database table.
Have you faced such a problem ?
Your advice/insight is appreciated.
I found out the cause of this. In my jsp, I was using
<html:submit ...................../> earlier which was causing the problem.
I changed the above to
<html:button...................../> which resolved the problem.
Joined: Jan 01, 2008
So, the request was being submitted twice.
Using <html:button.../> does not submit the form on clicking the button. Instead, we have to use document.form.submit(); to submit it.
subject: Servlet filter being invoked twice per request by Container.