struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Pass a parameter from action to other action with type result "chain"
Date Tue, 28 Mar 2017 07:40:40 GMT
2017-03-27 10:25 GMT+02:00 Dao Cong Hung (FSU17.BU68)
<HungDC@fsoft.com.vn.invalid>:
> -------------------------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;

I would use rather the "actionRedirect" result instead of the "chain" result
https://struts.apache.org/docs/redirect-action-result.html


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