users@jersey.java.net

Re: [Jersey] JSONP

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 21 Jan 2010 13:09:14 -0800

On Thu, Jan 21, 2010 at 6:43 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>
...
>>> 3) Jersey declares to Jackson an exclude list of classes or package.
>>
>> That would mean changes in Jackson.
>
> Yes. Jackson does have a concept of an "exclude" list:
>
>    public final static HashSet<ClassKey> _untouchables = new
> HashSet<ClassKey>();
>    static {
...
>        // Then core JAX-RS things
>        _untouchables.add(new ClassKey(StreamingOutput.class));
>        _untouchables.add(new ClassKey(Response.class));
>    }
>
> Note the latter two. I think an extensible solution, where something else
> can also add to the "untouchables" list, may be worth exploring further as i
> think that would be the best solution to solve the problem.

Additionally, if there was a good way to pass per-request information,
jackson provider could quite easily add necessary prefix (json
function name, open-paren) before output, and suffix (close-paren)
afterwards. But it would have to know when to do this (and with what
function name).

-+ Tatu +-