users@jersey.java.net

[Jersey] Re: XML data vaidation with JAXB

From: John G. Lussmyer <Cougar_at_CasaDelGato.Com>
Date: Tue, 12 Jul 2011 11:00:41 -0700

Thank you, that does help.
I also found that we already have an @Provider for our JAXBContext -
which brings up the question, is there a standard way for me to get the
JAXBContext created by that @Provider to use in my Unmarshaller @Provider?

On 7/12/2011 7:58 AM, Pavel Bucek wrote:
> Hello,
>
> you can set your own Unmarshaller instance by implementing
> ContextResolver<Unmarshaller>:
>
> @Provider
> public class MyUnmarshallerResolver implements
> ContextResolver<Unmarshaller> {
> ...
> }
>
> See:
> http://jsr311.java.net/nonav/javadoc/javax/ws/rs/ext/ContextResolver.html
>
> Regards,
> Pavel
>
> On 7/12/11 4:42 PM, cougar_at_casadelgato.com wrote:
>> We are using jersey with jaxb generated classes.
>> We'd like to enable input data validation, but I've been unable to
>> figure out just how to do this.
>> Is there a tutorial somewhere for this?
>>
>> It looks like I'll need to generate a schema from the xsd file, but all
>> the instructions for using it involve setting up an unmarshaller -
>> which jersey seems to do internally, so I don't have access to it.
>>
>
>


-- 
--
John G. Lussmyer	  mailto:Cougar_at_CasaDelGato.Com
Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com