On Thu, Jan 26, 2012 at 2:01 PM, Thiago H. de Paula Figueiredo <thiag...@gmail.com> wrote: > On Thu, 26 Jan 2012 10:49:39 -0200, Christian Grobmeier > <grobme...@gmail.com> wrote: > >> I do this in Struts (with my own S2 json plugin) > > Point to Tapestry, which does this out-of-the-box without plugins! :)
Well, in turn I can choose between 2 json plugins :-) But well, many people want their framework to be able to do anything. >> @JSON >> class MyAction { >> >> @JSON >> private Map results = ...; >> } > > > Thanks for the example. :) Does it support nested properties and arrays? I'm > talking about this: > > Nested property: c.d: > { > a: 'b'; > c: { > d: 'e' > > } > } Yes, you can do this: @JSON class MyAction { @JSON String a = "b"; @JSON Map m = .. } and so on which will result in something like you said. The plugin is here, if you want to take alook: https://github.com/grobmeier/jjson Struts has pretty less to do with it, except for a ResultType implementation which uses JJSON. Cheers >> private Map results = ...; >> } > > >> I need to put a note into struts.xml that I want a json response >> instead of a normal. >> (struts.xml is another dinosaur i don't like on s2, but there is the >> convention plug which supports annotations) > > > That's another huge Tapestry advantage: the lack of declarative navigation > rules that plague Struts (any version) and JSF. IMHO declarative navigation > rules an experiment that failed miserably. A solution (and a very bad one) > in search for a problem. > > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br -- http://www.grobmeier.de https://www.timeandbill.de --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org