users@jersey.java.net

Re: [Jersey] Jersey JSON serializer

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Wed, 27 Oct 2010 17:33:03 +0200

There is not the only one JAXB->JSON serializer in Jersey.
In fact there are many, two of them using Jackson underneath.
And to be honest: for backwards compatibility reasons,
the one set by default is not the best one to use.

The simplest answer to your question then would be:

My recommendation is:

1) use (Jackson based) POJO mapping feature as described in [1]
     starting from the Jersey version 1.5-ea03, this should also cover
     JAXB beans pretty well (i.e. considering JAXB annotations when
serializing JSON)

2) if you need to utilize some special JAXB features, check out the rest
of available
     methods described in the user doc

HTH,

~Jakub

[1]https://jersey.dev.java.net/nonav/documentation/latest/json.html#d0e1960

On 10/27/2010 01:03 PM, mxn wrote:
> Hi,
>
> Which are the reasons for which I might want to use the Jackson serializer
> or the JAXB serializer? Are there any advantages/disadvantages of using
> either of them? I saw the JAXB serializer is a bit more supported in the
> jersey documentation(the documentation for Jackson serializer is very
> narrow).
>
> Thanks!