Here is the proper configuration, see my comments below

<action name="chain1" class="example.Login">
    <interceptor-ref name="basicStack"/>
    <result name="success" type="chain">
        <param name="actionName">chain2</param>
    </result>
</action>
<action name="chain2" class="example.HelloWorld" >
    <interceptor-ref name="chainStack">
        <param name="chain.includes">username</param>
    </interceptor-ref>
    <result>/WEB-INF/jsp/example/HelloWorld.jsp</result>
</action>

2015-01-13 3:39 GMT+01:00 Tenchi Masaki <koouy...@gmail.com>:
> Yes, at first I thought that I was supposed to pass the "includes" param
> into the "chain" result like this:
>
> <action name="someAction" class="com.examples.SomeAction">
>        <interceptor-ref name="basicStack"/>
>         <result name="success" type="chain">
>             <param name="actionName">otherAction</param>
>             <param name="includes">prop1</param>
>         </result>
> </action>

ChainResult doesn't contain "includes" - it must be defined on ChainInterceptor

> <action name="otherAction" class="com.examples.OtherAction" >
>         <interceptor-ref name="chain" />
>         <interceptor-ref name="basicStack"/>
>         <result name="success">/result.jsp</result>
> </action>

There is "chainStack" which you can use instead of "chain" & "basicStack"

> But it doesn't work.

Yes as you must define "includes" for the result action (it strange
for me too and sorry for misleading you ... but it makes sense :) )

> I've tried this too and no success (actually it doesn't make sense at all,
> so it's good that it does not work.. lol):
>
> <action name="someAction" class="com.examples.SomeAction">
>         <interceptor-ref name="basicStack">
>             <param name="includes">prop1</param>

"basicStack" doesn't include "chain" interceptor, it won't work
either, instead you can do it like this

<interceptor-ref name="chainStack">
    <param name="chain.includes">prop1</param>
</interceptor-ref>

>         </interceptor-ref>
>         <result name="success" type="chain">
>             <param name="actionName">otherAction</param>
>         </result>
> </action>
> <action name="otherAction" class="com.examples.OtherAction" >
>         <interceptor-ref name="chain" />
>         <interceptor-ref name="basicStack"/>
>         <result name="success">/result.jsp</result>
> </action>
>
> And last:
>
> <action name="someAction" class="com.examples.SomeAction">
>         <interceptor-ref name="chain" >
>             <param name="includes">prop1</param>
>         </interceptor-ref>
>         <interceptor-ref name="basicStack"/>
>         <result name="success" type="chain">
>             <param name="actionName">otherAction</param>
>         </result>
> </action>
> <action name="otherAction" class="com.examples.OtherAction" >
>         <result name="success">/result.jsp</result>
> </action>

Almost there, but just move <interceptor-ref name="chain" > to the second action

And to close this issue I have updated the docs - thanks for support!
https://cwiki.apache.org/confluence/display/WW/Chaining+Interceptor



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

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

Reply via email to