Musachy Barroso wrote:
> 
> I've found that the "Config Browser" plugin helps me a lot to debug this
> kind of problems.
> 

I'll have to look into that plugin.  In the meantime, I think I've got it
figured out.  I had Struts' zero config feature enabled in my web.xml:

        <init-param>
            <param-name>actionPackages</param-name>
            <param-value>com.gfs.item.webapp.action</param-value>
        </init-param>

Once I pulled that out, everything started working as expected (i.e., I
could use "item" as the Action name).  I think the problem was a mish-mash
of zero configuration and explicit configuration.  Once things were working,
I re-enabled zero config, went back and annotated my Action class, and
removed the explicit setup in the struts.xml.  Now my struts.xml looks like
this:

<struts>
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true" />
    <constant name="struts.objectFactory" value="spring"/>
</struts>

My action annotations look like this:

@Result(value = "", type = JSONResult.class)
@ParentPackage(value = "json-default")
public class ItemAction {
...
}

And I get JSON results when accessing
http://localhost/itemService/item.action?id=100129.  It's a lovely thing.

Time to play around with the RestfulActionMappers ;-)

Kyle

PS - As a Struts 1 and JSF refugee, I've been very impressed with Struts 2
so far!  Kudos to all the developers.
-- 
View this message in context: 
http://www.nabble.com/-S2--JSON-Plugin-and-No-Result-Defined-tf3608118.html#a10084044
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to