6

I see some are using Jersey w/ Spring. With Spring 3.0 there are now annotations available to make RESTful APIs directly in a controller. Why should I consider using Jersey w/ Spring?

jr.
  • 4,503
  • 7
  • 44
  • 62
  • Can you please tell what version of jersey and spring you used which are compatible with each other. –  Feb 07 '12 at 09:11
  • Relative: [Does Spring MVC support JSR 311 annotations?](http://stackoverflow.com/questions/7518391). – dma_k Apr 11 '12 at 18:17

2 Answers2

4

Jersey pros:

  • comes with specifications JSR 311
  • reference implementation for JSR 311
  • Restlet and RESTeasy are other implementations for JSR 311
  • better tooling (at least on Netbeans)
  • it is integrated with Spring and Guice

EDIT

A (very nice) Comparison of Spring MVC and JAX-RS

dfa
  • 114,442
  • 31
  • 189
  • 228
  • 1
    standard annotations? and better tooling – dfa Feb 02 '10 at 19:23
  • Thanks! So, when using it with spring you are really just using Spring for the IoC functionality, etc? The controller will actually be a Jersey implementation? Hopefully I am understanding this correctly. – jr. Feb 02 '10 at 19:37
  • Can you even use Jersey with Spring 3.0? – jr. Feb 02 '10 at 20:34
  • check out jersey-spring: https://jersey.dev.java.net/nonav/apidocs/latest/contribs/jersey-spring/index.html – dfa Mar 21 '10 at 09:26
  • Jersey has built in support for jsonp, spring 3 you have to write additional code to get it working. Otherwise the features are comparable – Kevin May 05 '12 at 16:05
0

Spring 3 is backwards compatible so you can use Jersey.

What you get is not tying your application to a propietary API.

Jeduan Cornejo
  • 865
  • 2
  • 8
  • 19
  • I tried to use Spring 3.0, but had some strange dependency issues I didn't feel like tracking down, so went back to 2.5.6.SEC01 and I am now fine. I'm sure I could have gotten it to work, but didn't think I needed anything from 3.0. So, I think I get it now. You can simply annotate the objects using the standard Java annotations for REST and then later change architectures. By using Spring you get all the benefits of the IoC and applicationContext to manage your objects. So, it kind of is the best of both. I have a working solution so far.. – jr. Feb 03 '10 at 04:15