users@jersey.java.net

Re: JSON notation in Jersey

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 04 Apr 2008 11:46:43 +0200

On Apr 4, 2008, at 11:14 AM, Seamus Kerrigan (skerriga) wrote:

> Hi,
>
> I've been doing some work with Jersey for the past while but
> yesterday I
> got to try out Jersey 0.7 and it looks as though Badgerfish
> notation is
> now the default JSON format again?

That should not be the case, it is a bug if so (i would have expected
some unit tests to fail and i do not see any failures related to
this). I will let Jakub reply in more detail.


> I found that early Jersey versions
> were using Badgerfish by default but 0.6 was using the Mapped notation
> as it's default as outlined in Jakub's blog
> http://blogs.sun.com/japod/entry/better_json_available_in_jersey.
>
> I just have a couple of questions on this JSON formatting:
> - Is Badgerfish likely to be the preferred JSON notation in future
> Jersey releases?

No.


> - Will XmlAttributes be supported in the Mapped/Mapped-Jettison
> formats?
> - The blog outlines a method of changing between JSON formats by
> defining a ContextResolver. Is still this valid in 0.7?

Yes.


> I gave this a
> very quick try yesterday but was unsuccessful.
>

Can you provide some sample code?

Thanks,
Paul.