在 Eclipse 上安装和使用 Jersey

发布于 2024-11-07 08:52:58 字数 367 浏览 3 评论 0原文

在我的 Web 服务中,我使用 eclipse、java 1.5、spring。现在我想使用球衣进行 REST 并从以下地址将球衣作为捆绑包下载:

http:// jersey.java.net/nonav/documentation/latest/chapter_deps.html

如何将此 jar 添加到我的项目中并开始使用 JAX-rs 注释,我添加到了 buildpath 但似乎不起作用。

另外,创建我的资源类的 JAXB 带注释的类并将它们与 JERSEY 一起使用是否有必要或者是个好主意?

In my Web service I use eclipse, java 1.5, spring. now I want to use jersey for REST and downloaded the jersey as a bundle jar from this address:

http://jersey.java.net/nonav/documentation/latest/chapter_deps.html

How can I add this jar to my project and start using the JAX-rs annotations, I added to buildpath but seems like does not work.

Also is it necessary or a good idea to create JAXB annotated classes of my resource classes and using them with JERSEY?

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

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

发布评论

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

评论(1

狼性发作 2024-11-14 08:52:58

确保类路径上有 jsr-311 jar。
例如,您可以从此处。

Jersey 支持开箱即用的 JAXB。这并不意味着您必须使用 JAXB。如果您需要将数据序列化到 xml 或从 xml 序列化数据,则将 JAXB 与 Jersey 结合使用是最方便的。

Make sure you have jsr-311 jar on your classpath.
For example you can download it from here.

Jersey supports JAXB out-of-the-box. It doesn't mean you have to use JAXB. If you need to serialize data to/from xml, using JAXB with Jersey is the most convenient.

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