users@jersey.java.net

Re: [Jersey] JSONP

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 21 Jan 2010 10:22:00 +0000

On Jan 21, 2010, at 9:08 AM, Jakub Podlesak wrote:
> Since the Jackson writer is enabled by the application via the META-
> INF/services,

Ah, i got it now. Yes, in the sample (or registered via Application/
ResourceConfig) application registered providers will take precedence.


> it is given higher priority then the JSONWithPaddingProvider, and
> the delegation
> never happens.
>

Possible solutions and work around(s):

1) introduce a priority ordering. This would be easy to with
@Produces("application/json;qs=2, */*").
      or state that certain providers cannot be overridden.

2) re-register the JSONWithPaddingProvider ahead of the Jackson
providers.

3) Jersey declares to Jackson an exclude list of classes or package.

Paul.