0

Jersey and RESTEasy are popular JAX-RS implementations. There are other Rest Webservice implemenations such as Restlet.

I want to know which one to use when? what is the most used implementation nowadays in web application developments.

user3448119
  • 107
  • 10

1 Answers1

1

I'd go for Spring MVC version of REST, it suppports Dependancy Inversion(DI), Also spring supports many pluggable features like support for freemarker template, jaxb, xmlbeans etc., you will have plenty of options on return data.

Also, i wouldn't disagree on using jersey or resteasy, they are very lightweight compared to spring. If you don't want to use spring, then either one of the above mentioned should work as well, there are no major pros and cons.

Zeus
  • 6,386
  • 6
  • 54
  • 89
  • CDI also supports Dependency Injection (not Inversion, probably you thought on Inversion of Control [IoC] which is also provided by CDI) and you can implement RESTful services using this technology. Also, I've implemented JAX-RS services using jersey and it's integrated with Spring with no Spring MVC **at all**. – Luiggi Mendoza Mar 24 '14 at 19:42
  • Thanks Zeus.for REST in Spring MVC, which Spring dependency modules should be included. I think there is no specific module that deals wit h only rest. I guess, it should be taken care as part of spring core and web modules? – user3448119 Mar 24 '14 at 19:43
  • Luiggi Mendoza, what is CDI? – user3448119 Mar 24 '14 at 19:44
  • @LuiggiMendoza I agree, we can integrate anything with spring. – Zeus Mar 24 '14 at 19:46
  • @user3448119 you may have to use, core, web and webmvc dependencies to get going. – Zeus Mar 24 '14 at 19:47
  • @user3448119 Context and Dependency Injection [CDI](http://docs.oracle.com/javaee/7/tutorial/doc/cdi-basic.htm) is a framework that comes already shipped in any Java EE 6 or 7 container. And the fact I despite the answers saying *use this framework because it will solve your needs* is not as simple as it may look at the first glance. What you have to do is first define which requirements you have: performance, which technologies we already use, team knowledge and training, and others. Then, based on this, you prepare your scenarios and make your proof of concept per framework. – Luiggi Mendoza Mar 24 '14 at 19:51
  • Thanks Luiggi Mendoza – user3448119 Mar 24 '14 at 19:58
  • @Zeus, if we are using Spring MVC to implment REST Webserice, how does it different from Spring MVC which involves servlets,.. – user3448119 Mar 24 '14 at 23:44
  • You may have to tweak it a little to make it behave like REST service. Like returning http status code http://stackoverflow.com/questions/16232833/how-to-respond-with-http-400-error-in-a-spring-mvc-responsebody-method-returnin. Also, in regular mvc you just use get or post, here you have to use put, delete, get, post http methods. http://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch18s02.html – Zeus Mar 25 '14 at 16:29