使用Jersey开发RESTful Web Service时如何格式化结果?

发布于 2024-10-09 14:22:12 字数 96 浏览 0 评论 0原文

我使用 Jersey 开发 RESTful Web Service,但结果 xml 和 json 字符串格式不正确,难以阅读。如何格式化结果 xml 和 json 字符串?谢谢。

I use Jersey to develop RESTful Web Service, but the result xml and json string is not well formated, it's hard to read. How do I format the result xml and json string? thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白况 2024-10-16 14:22:13

您使用什么类型的 xml 支持?如果是 JAXB,那么您可以使用注释,如果您使用低级 xml 类(例如 SAX 或 DOM Source),则可以使用它的方法。

What type of xml support do you use? If it's JAXB, then you can use annotations, if you work with low level xml classes such SAX or DOM Source, then use it's methods.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文