阅读背景:

如何在使用注释时在JAXB unmarshaller上设置自定义ValidationEventHandler

来源:互联网 

We’re using JAX-WS in combination with JAXB to receive and parse XML web service calls. It’s all annotation-based, i.e. we never get hold of the JAXBContext in our code. I need to set a custom ValidationEventHandler on the unmarshaller, so that if the date format for a particular field is not accepted, we can catch the error and report something nice back in the response. We have a XMLJavaTypeAdapter on the field in question, which does the parsing and throws an exception. I can’t see how to set a ValidationEventHandler onto the unmarshaller using the annotation-based configuration that we have. Any ideas?We’re using JAX-WS in combination with JAXB to




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: