jim_gre...@fws.gov wrote:
I've worked around the problem inconsistent JSON results by removing the
root parameter from the JSONResult annotations. It appears that
at least I'm getting consistent results this way:
@Results( {
@Result(name = "jsonPopsResult", type = JSONResult.class, value =
"", params = {"noCache", "true"}),
@Result(name = "jsonRefugesResult", type = JSONResult.class, value
= "", params = {"noCache", "true"})})
The params attribute was previously
params = {"root", "jsonResult", "noCache", "true"}
Fortunately, the jsonResult property on the action is the only
non-base-class property, so I'm still returning only what I need.
FYI, as was suggested, I tried configuring the action via xml instead of
annotations, but for some reason couldn't get the
action's results to be recognized:
<package name="wizard" extends="myapp" namespace="/wizard">
<action name="mapQuery"
class="gov.doi.myapp.actions.wizard.MapQueryAction">
<result name="jsonPopsResult" type="json">
<param name="root">jsonResult</param>
</result>
<result name="jsonRefugesResult" type="json">
<param name="root">jsonResult</param>
</result>
</action>
</package>
I got "No result defined for action
gov.doi.myapp.actions.wizard.MapQueryAction and result success". Probably
some
stupid error on my part, but I don't have time to work on it further right
now. If I ever ascertain that the problem goes away
with xml config, I'll let the list know.
What is that struts-plugin.xml you're including in struts.xml?
Also, the config-browser can be handy for seeing what S2 thinks your
configuration is.
Does your action subclass ActionSupport? If so, it sounds like for some
reason you're hitting the default execute() impl, which will return
"success".
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org