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.C. Baltz" <kc...@lollimail.com> on 2003/05/14 19:18:07 UTC
Re: Struts - Button Event
This works for me:
<html:form action="sendEmail">
... various form elements ...
<html:submit value="send" property="action"><bean:message
key="composeEmail.sendButton"/></html:submit>
<html:submit value="edit" property="action"><bean:message
key="composeEmail.editButton"/></html:submit>
</html:form>
Then, in the Action, I test for which button was pressed like this:
if("edit".equals(request.getParameter("action")))
{
return actionMapping.findForward("edit");
} else if("send".equals(request.getParameter("action")))
return actionMapping.findForward("send");
}
Hope that helps,
K.C.
V. wrote:
>Hi,
> I have a webpage with two button name clickone and clicktwo.I have written an servlet named buttonservlet using Action class.On clicking the two buttons one by one i want to invoke the same buttonservlet.How to do.Are there any option to specify in struts-config.xml file.Pls do help me out i solving this problem.
>
>Thanks,
>Jai
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org