Originally posted by Satou kurinosuke:
Yes you can. You'll have to tell the servlet which action you wish to execute though. You could use a request parameter like "action=add", or "action=substract", depending on which button you press.
action attribute in form element specifies the servelet name.The question is to have a single servler.
You can do this by many ways, one I have given below:
<FORM ACTION="/cool/javaranch">
..
..
..
<INPUT TYPE=SUBMIT NAME="test" VALUE="ADD">
<INPUT TYPE=SUBMIT NAME="test" VALUE="SUB">
</FORM>
Query for VALUE in the servlet and proceed accordingly.
An Example