users@jersey.java.net

Re: [Jersey] Upgraded from Jersey 1.1 to 1.4, and JSON now has "null" values throughout

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Wed, 6 Oct 2010 10:38:30 -0700

On Wed, Oct 6, 2010 at 9:56 AM, Tim McCune <tim_at_mccune.name> wrote:
> Hmm, I haven't made any changes to my application to enable Jackson.  Jersey
> just started using Jackson when I upgraded from 1.1.5.1 to 1.4.  So maybe
> there is some unintended side-effect of the way that I've always used Jersey
> that is enabling Jackson?  At any rate, with Jackson doing the marshalling,
> I'd still expect it to not output the "null"s, which it seems to be doing
> when it's turned on in Jersey, regardless of whether or not it's actually
> supposed to be turned on. :)

It really depends on who is enabling support -- Jackson has no
knowledge of Jersey, so it uses its defaults unless explicitly told
otherwise.
This behavior is not mandated by JAX-RS, either; so both approaches
are equally valid from general viewpoint. I agree in that for
backwards compatibility changes in behavior do not make sense.

-+ Tatu +-