m just beginning with servlets and having a confusion.
In an html form, if there are multiple submit buttons in the same form and these requires different actions to be performed then how in the corresponding servlet we'll be able to recognize which button pressed.
Have you used any browser tools to see if the request has the expected parameters? (And please properly indent your code -- hard to read with no indentation.)
Joined: Sep 12, 2012
Bear Bibeault wrote:Have you used any browser tools to see if the request has the expected parameters? (And please properly indent your code -- hard to read with no indentation.)
Deleted all the useless information(like the scriptlet), now the code is easy to read.
No, I have not used any browser tools and I have no idea on how to do that.
Anyway, my problem now is different...
Now the form has: method='post', enctype='multipart/form-data'.
The method i was using to recognize which of the submit buttons was clicked (in the servlet) was iterating over all the FileItem(s) sent with the request and if the name of any of them was the name of any of the 3 buttons in my form, then that button was the one that the user clicked. This worked perfectly when the buttons had type=submit, but now that they are simple buttons apparently they are not sent with the request, so when i get the FileItems in the servlet none of them is any of the buttons... so the trick i was using before is useless now.