I would try populating the method with a splitting of the actionname for applicable method Here, a reference to "editCrud" will call the edit method on an instance of the Crud Action class. Likewise, a reference to "deleteCrud" will call the delete method instead. <action name="*Crud" class="example.Crud" method="{1}">
http://struts.apache.org/2.0.14/docs/action-configuration.html that is one solution..i am sure there are many others HTH Martin Gainty ______________________________________________ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Wed, 6 May 2009 14:48:58 -0700 > From: cm132...@gmail.com > To: user@struts.apache.org > Subject: S2 - s:submit method="value" has to be hard-coded? > > > There is a scenario where the same submit button needs to handle three > different method calls in a dispatch action. To avoid coding the same button > three times, I tried > > <s:submit value=" Save " method='<s:property value="methodName"/>' /> > java.lang.NoSuchMethodException: com.abc.xyz.struts.ExampleDispatchAction.() > > <s:submit value=" Save " method="<%=methodName%>"/> > org.apache.jasper.JasperException: /jsp/example/exampleEdit.jsp(130,11) > According to TLD or attribute directive in tag file, attribute method does > not accept any expressions > > <s:submit value=" Save " method="<s:property value="methodName"/>"/> > org.apache.jasper.JasperException: /jsp/example/exampleEdit.jsp(132,88) > equal symbol expected > > It seems like we have to hard code the method value. Is there a better way > to handle this? > -- > View this message in context: > http://www.nabble.com/S2---s%3Asubmit-method%3D%22value%22-has-to-be-hard-coded--tp23416227p23416227.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009