struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dao Cong Hung (FSU17.BU68)" <Hun...@fsoft.com.vn.INVALID>
Subject RE: Pass a parameter from action to other action with type result "chain"
Date Mon, 27 Mar 2017 08:25:10 GMT
-------------------------I convert struts1 to struts2-----------------------------------
-------------------------Struts1: ----------------------------------------
<action	path="action1 "
		type="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction1">
	<forward name="error"      path="/ action2.do?name=close " />
    </action>
<action	path="action2 "
		type="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction2">
	<forward   name="success"    path">/jsp/showResult/success.jsp " />
    </action>
=>So at controller of action2 in class PostLauncherAction2, I use request.getParameters("name")=close;
------------------------------Struts2---------------------------------------------
<action name="action1"
                    class="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction1">
                         <result name="error" type="chain">
                                 <param name="actionName">action2</param>
                                 <param name="name">close</param>
                        </result>
 </action>
 <action name="action2"
                         class="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction2">
                        <result 
 name="success">/jsp/showResult/success.jsp</result>
 </action>
> So at controller of action2 in class PostLauncherAction2, I use request.getParameters("name")=null;

-----Original Message-----
From: Lukasz Lenart [mailto:lukaszlenart@apache.org] 
Sent: Mondàà 27 März 2017 15:17
To: Struts Users Mailing List
Subject: Re: Pass a parameter from action to other action with type result "chain"

2017-03-27 9:31 GMT+02:00 Dao Cong Hung (FSU17.BU68)
<HungDC@fsoft.com.vn.invalid>:
> <action name="action1"
>                         class="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction">
>                         <result name="error" type="chain">
>                                 <param name="actionName">action2</param>
>                                 <param name="name">close</param>
>                         </result>
> </action>
> <action name="action2"
>                         class="jp.co.fujixerox.eappli.printapp.struts.PostLauncherAction">
>                         <result 
> name="success">/jsp/showResult/success.jsp</result>
> </action>
> So at controller of action2, I use request.getParameters("name")=null;

hm... but the "name" parameter from the "action1" isn't a request parameter, it will be applied
only to the "action1".


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Mime
View raw message