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?
+1
A:
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
dfa
2010-02-02 16:30:13
ok, but what do I get over using Spring 3.0 w/ annotations? How does Jersey make my life easier before I dive in and learn something new. :-/
jr
2010-02-02 19:01:39
standard annotations? and better tooling
dfa
2010-02-02 19:23:43
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
2010-02-02 19:37:57
Can you even use Jersey with Spring 3.0?
jr
2010-02-02 20:34:29
check out jersey-spring: https://jersey.dev.java.net/nonav/apidocs/latest/contribs/jersey-spring/index.html
dfa
2010-03-21 09:26:15
A:
Spring 3 is backwards compatible so you can use Jersey.
What you get is not tying your application to a propietary API.
Jeduan Cornejo
2010-02-03 03:30:05
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
2010-02-03 04:15:37
A:
I integrated our Jersey project with Spring, but just for dependency-injection stuff and some other things. We're still using Jersey's service front-end, not Spring's MVC.
gmoore
2010-06-03 20:00:40