Hi I think we can quite easily support it, by registering a simple writer which will wrap the Jettison one and drop the root element. The "JSON in CXF - root element dropped" thread is more about wrapping the incoming sequence. I will just add a property to JSONProvider which will enable it to do it.
cheers, Sergey Andreas Hartmann wrote: > > Hi everyone, > > I'm a total CXF newbie and want to setup a JAX-RS service to use with > the DOJO JsonRestStore. ATM I'm using CXF 2.2.2. > > Is there a way to configure the JSON marshalling not to insert a root > element? I found out about the JsonWriter.DROP_ROOT_MODE parameter: > > "Therefore it is possible to drop this root by initializing the > internally used JsonWriter in a different mode." [1] > > new JsonWriter(writer, JsonWriter.DROP_ROOT_MODE); > > Is it possible to configure CXF so that the JsonWriter is initialized > with this parameter? > > > I have already read the thread "JSON in CXF - root element dropped", but > it looks like I'd have to work with the trunk and make myself familiar > with some CXF internals. Is there an easier way to achieve this? > > Thanks a lot in advance for any hints! > > [1] http://xstream.codehaus.org/json-tutorial.html > > -- Andreas > > -- > Andreas Hartmann, CTO > BeCompany GmbH > http://www.becompany.ch > Tel.: +41 (0) 43 818 57 01 > > > -- View this message in context: http://www.nabble.com/How-to-enable-JsonWriter.DROP_ROOT_MODE--tp24585380p24586592.html Sent from the cxf-user mailing list archive at Nabble.com.
