JAX RS Jersey Schema Validation

走远了吗. 提交于 2019-12-23 15:46:14

问题


How to configure schema validation for JAX-RS RESTFul services?

We are using XSD to define the models, and JAXB to generate the java models.


回答1:


This is how it's done automatically in ReXSL: XslResolver#addXsdValidatorToMarshaller() (pay attention to the highlighted method). In a nutshell, you need to use setSchema() of your JAXB Marshaller.



来源:https://stackoverflow.com/questions/3886653/jax-rs-jersey-schema-validation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!