You could either handle this in the browser (by having each submit button use JavaScript to set the action attribute before submitting the form), or on the server (by having a servlet that dispatches to one of the 3 others based on the name attribute of the submit button),
How do we decide which servlet to be invoked used action event for submit button using JavaScript. Some where I heard that AJAX is used for these kinds of purposes.
Also how do we get the attribute of the submit button using the request object? who would set the attribute for the request, so that it can be retrieved at the later point?
Also is there any way that servlet can know which actual button is clicked on the client machine.
Originally posted by Chandra Kota:
I didn't understand getting parameter using request.getParameter("form_action"). What is form_action referring to here. Where is this taken from?
Also in the web.xml,
servlet mapping is done *.do, does this mean any name with extension "do" would invoke the servlet "ControllerServlet". I mean any irrelevant name say "http://localhost:8080/SimpleCommand/javaranch.do" also invokes "ControllerServlet". Please let me know, if my understanding is correct.[/QB]
Water proof donuts! Eat them while reading this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|