sgzwiz / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 1 forks source link

Switch default root object to stack.getRoot() #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, first thanks for this wonderful plugin.
I have only a little note:
I think that is more correct that the default root result object should be top 
of 
the stack (stack.getRoot()), that in most of the cases is the action itself, 
instead of invocation.getAction().
This is more XWork/Struts-like, because some of the interceptors (like model-
driven or execute-and-wait) replace the action on top of the stack and result 
of 
the json interceptor, in my opinion, should serialize following  this mechanism 
(like others default results provided by Struts).
I know that I can use root = '[0].top', but it's not the same thing.

Thanks in advance,
Simone.

Original issue reported on code.google.com by simone.ricciardi on 15 Dec 2008 at 4:10

GoogleCodeExporter commented 9 years ago
this is a good point, but it would break backward compatibility, while there is 
a
workaround.

Original comment by musa...@gmail.com on 26 Dec 2008 at 7:43

GoogleCodeExporter commented 9 years ago
actually you can just use root="top"

Original comment by musa...@gmail.com on 30 Dec 2008 at 2:29