users@jersey.java.net

[Jersey] Re: Guice and custome JSONJAXBContext

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 20 Jan 2011 11:39:04 +0100

[resend due to java.net glitch]

On Jan 20, 2011, at 3:03 AM, Chad wrote:

>
> I'm using Jersey with Guice and all is working fine.
>
> We now want to customize our JSON generation and I've been following
> the
> instructions to set up a JAXBContextResolver.
>
> Is this at all compatible with Guice. I noticed that creating my own
> JSONJAXBContext requires me to specify classes or packages.
>

Yes, just like for JAXBContext it is a constraint with JAXB. Note that
one can also pass an array of classes. However JAXB will not defer to
Guice to instantiate such classes. I don't know enough about JAXB to
say if it is possible to integrate JAXB with Guice.

Paul.

> This seems incompatible to the binding model used with the rest of
> Jersey
> and Guice.
>
> Any recommendations on getting this to work?
>
> thanks
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Guice-and-custome-JSONJAXBContext-tp5942158p5942158.html
> Sent from the Jersey mailing list archive at Nabble.com.