users@jersey.java.net

[Jersey] Re: XML data vaidation with JAXB

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 12 Jul 2011 16:58:49 +0200

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.
>