users@jersey.java.net

Re: [Jersey] Simple attempt to output JSON from JAXB class still returning JAXB

From: Paul Taylor <paul_t100_at_fastmail.fm>
Date: Wed, 04 Nov 2009 19:42:23 +0000

Jakub Podlesak wrote:


> instead of creating Marshaller, try to get JSONMarshaller (see [1])
> and than call marshallToJSON method ([2]).
>
> HTH,
>
> ~Jakub
>
> [1]https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/json/JSONJAXBContext.html#createJSONMarshaller()
> [2]https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/json/JSONMarshaller.html#marshallToJSON%28java.lang.Object,%20java.io.Writer%29
>
>
Thanks that works , didnt notice these because my ide was still pointing
at json 1.0.3, but dont really know why it just doesnt override the
existing marshal methods to return json instead of xml.

Paul