This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
in my application, the request is getting submitted twice even though i'm submitting the form only once by clicking on the submit button? What might be the possible reasons for the request getting submitted twice?
what is <html:image... sounds like JSF to me which I have a very limited idea of. The rason that comes to my mind is that the request is getting submitted twice because the <htm:image... is being rendered as a submit button for the form. something like <input type="image" .... See the generated code to see if that's the case. So in that case when you click on the image, the image would submit the request and inturn also call the submit method which would again submit the method. Try removing the submit from the submit() function and see if it helps.
The problem is exactly as previously stated: the click of the image button (which has submit semantics) is initiating a form submission. Within the handler, the form is also be submitted under script control by calling submit. The results is a double submission.
Either the original submission must be derailed (by returning false from the handler), or the submit() method should not be called. I;d opt for the latter as the call is completely unecessary.