users@jersey.java.net

Re: [Jersey] JSON in Jersey

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Wed, 24 Mar 2010 09:27:17 +0100

Hi John,

I am sorry for late response.

On Sun, Feb 28, 2010 at 10:00:05PM +0000, John Lister wrote:
> Sorry for the email blast...
> It looks like i'm encountering the same issue as
> https://jersey.dev.java.net/issues/show_bug.cgi?id=296. I am interfacing
> with none Jersey JSON libraries which barf on the {nill:true} form.
> I'll try the jackson provider to see what happens..

The jackson provider should solve your issue, as it generates
JSON from Java object model directly rather than via XML API.

An example could be seen at [1],

~Jakub

[1]http://download.java.net/maven/2/com/sun/jersey/samples/jacksonjsonprovider/1.1.5.1/jacksonjsonprovider-1.1.5.1-project.zip

>
> Thanks
>
> John
>
> Felipe Gaścho wrote:
> >please post again your class definition...
> >
> >but I checked here and it seems to be {nill:true}
> >
> >an example of my own code:
> >
> >curl -XGET -HAccept:application/json
> >http://fgaucho.dyndns.org:8080/arena-http/homework
> >
> >
> >
> >On Sun, Feb 28, 2010 at 10:39 PM, John Lister
> ><john.lister_at_kickstone.co.uk> wrote:
> >
> >>Felipe Gaścho <fgaucho_at_gmail.com> wrote:
> >>
> >>>>you need natural notation...........
> >>>>
> >>Ok, I've got natural notation working, but there is still a problem:
> >>
> >>I now get:
> >>{
> >> aValue: 123,
> >> nullValue: {
> >> nill: true
> >> }
> >>}
> >>
> >>
> >>whereas I would like to have
> >>{
> >> aValue: 123,
> >> nullValue: null
> >>}
> >>
> >>
> >>Any ideas?
> >>
> >>Thanks
> >>
> >>John
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
http://blogs.sun.com/japod