users@jersey.java.net

[Jersey] ContextResolver is called by AbstractRootElementProvider but not JacksonJsonProvider

From: Pengfei Di <pengfei.di_at_match2blue.com>
Date: Fri, 8 Apr 2011 11:33:32 +0200

Hello,

I have tried to make the JSONConfiguration working for a long time, but
still not succeed.

I added a JAXBContextResolver (from Example 5.6) into my test project,
and found something intresting in the method ContainerResponse.write():
If the response type is specified as "xml", an
AbstractRootElementProvider will be used to perform the writeTo()
method, and the JAXBContextResolver will be further used. (However, this
is useless for me, since I need JSON representation.)
if the response type is specified as "json", a JacksonJsonProvider will
be used, and it will never call JAXBContextResolver!!

Is it correct that JacksonJsonProvider is called here? If it is correct,
how can specify my JSONConfiguration to it?

Thanks a lot in advance?
Pengfei