You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by K Br <ko...@ny.com> on 2002/10/06 16:00:23 UTC

Specifying button-specific actions in a form

I have a form with three commands (add, delete and logout). It appears to me that I must forward them
to a single action and conveying the specific
operation using a property as in:

 <html:form method="GET" action="processCommand.do">
     //...
     <html:submit property="action" value="Add" />
     <html:submit property="action" value="Delete" />
     <html:submit property="action" value="Logout" />
 </html:form>

I would like to make the JSP more readable by
specifying distinct actions to distinct buttons:
   Add -> /performAdd.do
   Delete -> /performDelete.do
   Logout -> /logout.do

(these actions may be implemented by the same
Action class, but that's hidden from the JSP 
author).

Is there a way to do this?
 
Tx,

/Kobe



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Specifying button-specific actions in a form

Posted by Pavel Kolesnikov <k...@les.cz>.
On 6 Oct 2002, K Br wrote:

> I would like to make the JSP more readable by
> specifying distinct actions to distinct buttons:
>    Add -> /performAdd.do
>    Delete -> /performDelete.do
>    Logout -> /logout.do
> 
> (these actions may be implemented by the same
> Action class, but that's hidden from the JSP 
> author).

@see org.apache.struts.actions.DispatchAction

pavel



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>