users@jersey.java.net

Re: [Jersey] How to serialize null property

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 23 Apr 2009 10:01:08 -0700

On Thu, Apr 23, 2009 at 2:28 AM, <amsmota_at_gmail.com> wrote:
> You can use your own NullObject, or use one of the many out there, that
> basically are obejcts with a
>
> String toString(){
> return "null";
> }
>
> But I don't know much about json, however...

In near (?) future, regular nulls can be serialized as such too, with
"native" JSON body writer (I sent a note a while back about prototype
version based on Jackson's data mapper).

Current problems with null stem (AFAIK) from the fact that xml itself
really has no null concept (it's just text), and because associated
schema info isn't (can't easily?) be passed through conversions from
object -> (JAXB) xml -> (jettison) json.

-+ Tatu +-