[Jersey] Re: Schema compliant marshalling

From: Jakub Podlesak <>
Date: Mon, 12 Sep 2011 15:34:40 +0200

Hi Veit,

You may want to try implement a custom ContextResolver (see [1]) for both
JAXB Marshaller and Unmarshaller and use setSchema method [2] on both
to switch validation on.




On 11.9.2011 11:06, Veit Guna wrote:
> Hi.
> I'm using Jersey for implementing a REST service. I've managed to add
> schema validation for incoming requests
> using the MessageBodyReader. That works so far. Now I've encountered,
> that responses generated by Jersey aren't
> schema compliant. Is there a way to tell Jersey to use a specific xml
> schema when marshalling the response?
> Thanks
> Veit