I have used the JSON plugin quite a bit and I have not seen the root
switching you are describing.  The only difference I can see is that I am
using xml config for those actions.  It seems like your result is not
getting the "root" parameter.  Could it be an issue with the @Result
annotation combined with the custom JSON result?



Jim_Greuel wrote:
> 
> I am using version 0.32 of the JSON plugin with Struts 2.0.11.  It seems 
> to work well except for the fact that the JSON results from my struts 
> action are inconsistent.
> I have annotated my action as follows:
> 
> @Results( {
>         @Result(name = "jsonPopsResult", type = JSONResult.class, value = 
> "", params = {"root", "jsonResult", "noCache", "true"}),
>         @Result(name = "jsonRefugesResult", type = JSONResult.class, value 
> = "", params = {"root", "jsonResult", "noCache", "true"})})
> public class MapQueryAction extends ActionSupport {
> ...
> }
> 
> Sometimes the response generated by the action is (for example)
> 
>         {"trustResources":[{"displayName":"Bull Trout","id":301}]}
> 
> at other times it is
> 
>         {"jsonResult":{"trustResources":[{"displayName":"Bull 
> Trout","id":301}]}}
> 
> Note that the second response has an outer level of wrapping that 
> corresponds to the root parameter in the annotation (the action property 
> to be serialized).
> 
> I think (though am not 100% positive) that the change in behavior happens 
> when I restart my tomcat container, so this smells strongly of a class 
> loading problem.  I've looked for duplicate jars/classes, but have come up 
> empty.  In particular, I have only one json-plugin jar 
> (json-plugin-0.32.jar) in my application's WEB-INF/lib directory.  Has 
> anyone else experienced this kind of problem with the JSON plugin?
> 
> Thanks,
> Jim Greuel
> 

-- 
View this message in context: 
http://www.nabble.com/JSON-plugin-class-loading-problem--tp23623320p23623981.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to