You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Milan Milanovic <mi...@yahoo.com> on 2008/12/26 15:39:23 UTC
[S2] Calling action class method from jsp
Hi,
I have iterator in my jsp which iterate through list of objects. I want to
call action call method for every object which is iterated, but also to pass
this object's id to that method, e.g.:
<s:iterator value="list">
...
<s:property value="callActionClassMethod('+id+')" />
...
</s:iterator>
How can I define this ?
--
Thx, Milan
--
View this message in context: http://www.nabble.com/-S2--Calling-action-class-method-from-jsp-tp21174848p21174848.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2] Calling action class method from jsp
Posted by Felipe Fraga <fe...@gmail.com>.
Hello,
I think you can use <s:action> inside the iterator. You probably also
need to create a <s:url> for each member of the iteration and set the
action with it.
You can find reference here:
http://struts.apache.org/2.0.14/docs/action.html
I haven't tried it, but I believe it will work.
Best regards,
Felipe Fraga
On Fri, Dec 26, 2008 at 12:39 PM, Milan Milanovic
<mi...@yahoo.com> wrote:
>
> Hi,
>
> I have iterator in my jsp which iterate through list of objects. I want to
> call action call method for every object which is iterated, but also to pass
> this object's id to that method, e.g.:
>
> <s:iterator value="list">
> ...
> <s:property value="callActionClassMethod('+id+')" />
> ...
> </s:iterator>
>
> How can I define this ?
>
> --
> Thx, Milan
> --
> View this message in context: http://www.nabble.com/-S2--Calling-action-class-method-from-jsp-tp21174848p21174848.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: [S2] Calling action class method from jsp
Posted by Martin Gainty <mg...@hotmail.com>.
Hello Milan-
you can supply the necessary init-params below the action definition as in this example<struts> <package name="edit" extends="struts-portlet-default" namespace="/edit"> <action name="index" class="com.opensymphony.xwork2.ActionSupport">
<init-param> <param-name>actionPackages</param-name> <param-value>org.apache.struts2.showcase.person</param-value> </init-param> <result name="success">/WEB-INF/edit/index.jsp</result> </action>HTHMartin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Fri, 26 Dec 2008 06:39:23 -0800> From: milanmilanovich@yahoo.com> To: user@struts.apache.org> Subject: [S2] Calling action class method from jsp> > > Hi,> > I have iterator in my jsp which iterate through list of objects. I want to> call action call method for every object which is iterated, but also to pass> this object's id to that method, e.g.:> > <s:iterator value="list">> ...> <s:property value="callActionClassMethod('+id+')" />> ...> </s:iterator>> > How can I define this ?> > --> Thx, Milan> -- > View this message in context: http://www.nabble.com/-S2--Calling-action-class-method-from-jsp-tp21174848p21174848.html> Sent from the Struts - User mailing list archive at Nabble.com.> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org>
_________________________________________________________________
Send e-mail anywhere. No map, no compass.
http://windowslive.com/oneline/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008