If the parameter name is the same for each submit button then its
corresponding value will be mutually exclusive in the request.

So if you have the following:

<input name="action" type="submit" value="action1"/>
<input name="action" type="submit" value="action2"/>
<input name="action" type="submit" value="action3"/>

You can determine the action in your Action class:

String action = request.getParameter("action");

or if action is a form data member:

String action = myForm.getAction();

If you want to avoid the conditional logic involved here, you
may want to look at DispatchAction or LookupDispatchAction.
They both use reflection to perform the conditional logic and
you only have to concentrate on the business logic.

HTH,

robert

> -----Original Message-----
> From: Radhika Nadkarni [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 11, 2002 5:47 AM
> To: [EMAIL PROTECTED]
> Subject: Different buttons in one JSP
>
>
> hi,
> Im having one JSP in which I have created 3 submit buttons. How can I
> identify these buttons in the Action class ?
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


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

Reply via email to