2014-11-05 13:41 GMT+01:00 Pavel Ilyushko <pavel.ilyus...@gmail.com>:
> Hi there!
>
> Thanks for a swift reply.
>
> Actually, re-defining the root is what I applied as a work-around.
>
> So in my struts.xml I have this (to fix setting the parameters on the
> action):
>
>                 <interceptor-ref name="json">
>                      <param name="root">action</param>
>                 </interceptor-ref>
>
> and also for each json action type I have this (to set the action fields
> for json response) :
>
>             <result type="json">
>                  <param name="root">action</param>
>             </result>
>
> Note, I'm using 'action' as the root. I found this in the code:
>
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.3.16.3/com/opensymphony/xwork2/DefaultActionInvocation.java?av=f
>
> see code for
>
>  public void  
> <http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.3.16.3/com/opensymphony/xwork2/DefaultActionInvocation.java?av=f#>init
> <http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.3.16.3/com/opensymphony/xwork2/ActionInvocation.java#ActionInvocation.init%28com.opensymphony.xwork2.ActionProxy%29>(ActionProxy
> <http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.3.16.3/com/opensymphony/xwork2/ActionProxy.java#ActionProxy>
> proxy) method, line 401:
>
>         if (pushAction) {
>             stack.push(action);
>             contextMap.put("action", action);
>         }
>
> As you can see, the "action" key is hard coded and specified nowhere in the
> official struts 2 doc. So it's kind of dangerous to rely on this key, since
> it might change in the future without notification.
>
> Is there a cleaner way to redefine the root, as you've suggested?

It won't change, please register an issue against documentation to
clarify this :-)


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