You can do this via the json plugin (https://cwiki.apache.org/WW/json-plugin.html - bundled with struts 2.1.7+) that provides the json result type, i.e., @Result(name="foo", type="json", ...) or you could set the contentType in your @Result params as application/json and have your associated template emit the exact json that you want to return.
On Tue, Jul 13, 2010 at 5:34 AM, JP Cafaro <jcafar...@gmail.com> wrote: > Is it possible to declare result-type using annotations? For example, when > trying to return an object, that gets serialized to json, is it possible to > move away from the struts.xml <result-type> and do it via annotations > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Allen Lee Center for the Study of Institutional Diversity [http://csid.asu.edu] Arizona State University | P.O. Box 872402 | Tempe, Arizona 85287-2402 Office: 480.727.0401 | Fax: 480.965.7671 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org