RESTEasy 还是泽西岛?泽西、RESTEasy

2023-09-06 10:59:24 作者:在水伊人

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?

Best Of 2012 2014

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

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.

解决方案

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.

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.

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

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