1) Yes you can do it
2) Given each button a different value, like "List Products" and "List All Products"
3) Add a "buttonValue" (or some other adequetly names) property to your form for the respective action, it will capture the button clicked.
4) In your action:


if(form.getButtonValue().equals("List Products"))
   // do stuff
else if(form.getButtonValue().equals("List All Products"))
   // do more stuff

Best,
Riyad

Miguel Arroz wrote:

Hi!

Can I have multiple submit buttons on the same form? Imagine I have "Button A" and "Button B" on a JSP, and I want to do slightly different things when a user clicks on each button. It's enough to detect, on the Action, the button the user clicked... but that's precisely my question. How can I know what button did the user pressed to submit the form?

  Yours

Miguel Arroz

                                                 Fire, walk with me.

  Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to