RESTEasy 还是 Jersey? [英] RESTEasy or Jersey?

查看:21
本文介绍了RESTEasy 还是 Jersey?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要 RESTFul 网络服务.由我的团队决定是否使用 Jersey、Restlet 或 RESTEasy 或其他任何东西.省略其他框架后,我们无法在 RESTEasy 和 Jersey 之间进行选择.

I have a requirement for RESTFul webservices. It is up to my team to decide whether to go with Jersey or Restlet or RESTEasy or anything else. after omitting other frameworks, we are not able to choose between RESTEasy and Jersey.

既然两者看起来差不多,那我们应该考虑什么?

Since both of them seem to be almost the same, what should we consider?

客户端 API 应该简单而丰富.我们已经在生产中使用 JBoss 5.1.

The client API should be simple and rich. We are already using JBoss 5.1 in production.

请告诉我 Jersey 和 RESTEasy 的优缺点.除了它来自 JBoss,我无法在泽西岛找到任何有效的点.

Please let me know the pros and cons of Jersey and RESTEasy. Except that it is from JBoss, I'm not able to find any valid point over Jersey.

推荐答案

Jersey 的一个很好的增值特性是 Jersey 测试框架,它允许您在 JUnit 中运行和测试您的 Jersey REST 服务,而无需首先部署它们到独立服务器,甚至在您将代码提交到存储库之前.

One nice value-add feature of Jersey is the Jersey Test Framework which lets you run and test your Jersey REST services inside JUnit, without the need to first deploy them to a stand-alone server and even before you commit your code to your repo.

这些测试很容易编写,您甚至可以在签入 Jersey 网络服务代码之前运行它们以确保您的服务正常工作,并且它们成为您的自动化测试套件的一部分,有助于强制执行您的服务所具有的合同您的客户.

These tests are easy to write, you can run them before you even check in your Jersey web service code to make sure your service is working, and they become part of your automated test suite which helps enforce the contract your services have with your clients.

请参阅这篇文章如果您使用的是 Jersety 1.X 或 这个 用于 2.x.

See this article for more information if you're using Jersety 1.X or this one for 2.x.

另一个不错的功能是支持 REST MVC 模式,它允许您从 Jersey 服务返回一个视图,而不仅仅是数据(模型).与 Jersey 测试框架的兼容性在这方面仍在完善中,但它是可行的.

Another nice feature is support for the REST MVC pattern, which would allow you to return a View from your Jersey services rather than just data (the Model). Compatibility with the Jersey Test Framework is still maturing in this regard, but it is workable.

有关这方面的更多信息,请参阅这篇文章:

See this article for more information on that:

http://usna86-techbits.blogspot.com/2013/12/jersey-jerseytest-migration-from-1x-to.html

这篇关于RESTEasy 还是 Jersey?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆