users@jersey.java.net

Re: [Jersey] Native JSON binding using JacksonJsonProvider

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Wed, 11 Mar 2009 15:29:38 +0100

Hi Tatu,

Please see inline...


On Mon, Mar 09, 2009 at 11:08:34AM -0700, Tatu Saloranta wrote:
> On Mon, Mar 9, 2009 at 8:56 AM, Jakub Podlesak <Jakub.Podlesak_at_sun.com> wrote:
> >
> > Hi Tatu,
> >
> > Very nice. Which version of jackson do i need to use?
>
> Thank you!
> Version to use is 0.9.9. I had to add some support for (optional)
> detection of supported types. Otherwise 0.9.8 would work too.

O.K.

>
> > Would you mind adding this provider to the jersey code base
> > after some testing?
>
> Not at all, I can do that. It does need testing, so maybe other users

Great! It should go to the jersey-json module [1].
And since the module currently depends on jackson 0.9.4,
you will need to tweak the pom,
and possibly also some already existing code
as well as i saw some minor
things changed in jackson in the meantime.

Then you should also register the provider
via adding it to the end of
META-INF/services/javax.ws.rs.ext.MessageBody(Reader|Writer)
lists instead of using the @Provider annotation.

If it will be added to the end of the list, it should not break
current functionality, namely for JSONObject/JSONArray/JAXB beans.

Paul said, he could work our a way how to make sure things will
keep working even for non META-INF/services based scenarios
later on.


> can help with that. It might also be nice to allow configuration
> through same mechanism as mapped json conventions?

Sure, lets discus this after the provider is added to the jersey-json module.
If i understand things correctly you have something similar to jaxb context,
in jackson which allows to configure things, right?
Then allowing people to provide such a jackson context should be the way.

~Jakub


>
[1]svn co https://jersey.dev.java.net/svn/jersey/trunk/jersey/jersey-json

> -+ Tatu +-
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>