Thanks Sergey Can you give me an example? Do i just add a <bean id="" class="" /> of my ExceptionMapper implementation?
<jaxrs:providers> ..... </jaxrs:providers> I saw the validation example, but i was wondering how i can have at the validator so i can massage the Response going back to the caller. On Tue, Jun 30, 2009 at 5:35 AM, Sergey Beryozkin <[email protected]>wrote: > Hi, > > You can register an exception mapper as a provider from Spring, inside a > jaxrs:providers tag. > > As far as the validation is concerned, here is how you can do it : > > http://cwiki.apache.org/CXF20DOC/jax-rs.html#JAX-RS-Schemavalidationsupport > > You can also inject an instance of ValidationEventHandler into a JAXB > provider. > Or you can get more control by registering a custom XMLStreamReader and do > some schematron-like validation in there...and throw some exception from > there....Let me know please if you'd like some more info on this last > option. > > cheers, Sergey > > > ----- Original Message ----- From: "Nathaniel Auvil" < > [email protected]> > To: <[email protected]> > Sent: Tuesday, June 30, 2009 2:57 AM > Subject: JAX-RS Exception Handlers and Validation > > > > I am looking at how to get validations and exception handling going. >> Right >> now i send some garbage XML in and it throws a JAXException back in the >> response. I would prefer to be able to handle this back on the serve and >> give the client a less specific error. >> >> I am using Spring to configure things and i did not see anything in the >> examples which shows me how to add an exception handler or how to get >> control of the XML Validations. Can anyone point me in the right >> direction? >> >> >
