users@jersey.java.net

Re: [Jersey] Native JSON binding using JacksonJsonProvider

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Wed, 11 Mar 2009 16:09:12 -0700

On Wed, Mar 11, 2009 at 7:29 AM, Jakub Podlesak <Jakub.Podlesak_at_sun.com> wrote:
...
>> > 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].

Makes sense.

> 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.

Yes.

> 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.

Yes, I suspected there must be a simpler way to register the provider.
I assume that might actually work from within other jars, even outside
of Jersey?

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

Yup that would be a pre-requisite.

...
> 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.

Right now configurability is bit scattered, and I actually entered an
entry in Jira to combine them. I think it'd be ok to have some
wrapping if necessary; I can have a look at what jersey's json jaxb
context has available currently to try to keep things compatible.

-+ Tatu +-