且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有用于 XML 绑定的 JavaScript API - 类似于 Java 的 JAXB?

更新时间:2023-01-25 17:07:45

JAXB 的 JSON 支持怎么样?重用当前的 JAXB 注释模型类,但从 REST 端点输出 JSON.

How about JSON support for JAXB? Reuse your current JAXB annotated model classes but output JSON from your REST endpoints.

Jersey 的当前版本支持这一点(通过 jersey-json 模块)和 JSONJAXBContext.

Current versions of Jersey support this (via the jersey-json module) with JSONJAXBContext.

你也可以试试 JacksonJAXBJAX-RS 支持.

You could also try Jackson's JAXB and JAX-RS support.