File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Jersey Based  RestFul Web service integrated with Spring example Required   Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Jersey Based  RestFul Web service integrated with Spring example Required   " Watch "Jersey Based  RestFul Web service integrated with Spring example Required   " New topic
Author

Jersey Based RestFul Web service integrated with Spring example Required

Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi ,

I am trying to build a Jersey Based Rest Web servuce with Spring but I couldn't find an example online that works... Could someone share a simple sample if possible?
Thanks
Have a nice day
Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
This is what I tried,





applicationContext.xml




My web.xml




There are probably tons of mistakes. I couldn't find an example I could easily understand so I resorted to pulling out pieces of code from various examples and patching it together, Frankenstein Style
Any help is appreciated.

Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
What would the "integration" with Spring do? If you have a web app -whether Spring-based or not- you should have no problem adding Jersey to it.


Ping & DNS - my free Android networking tools app
Maya sekar
Ranch Hand

Joined: Sep 22, 2011
Posts: 70
Hi,

By integration I mean that I am trying to write a Jersey based Rest Web Service using Spring Framework....

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
Yes, but what would Spring add that Jersey/JAX-RS doesn't do? In other words, what exactly are you trying to implement with Spring but struggling to get done? Spring doesn't do REST, Jersey/JAX-RS does. You should have no problems using Spring's DI in your JAX-RS classes, if that's what you mean.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Ulf Dittmer wrote:Yes, but what would Spring add that Jersey/JAX-RS doesn't do? In other words, what exactly are you trying to implement with Spring but struggling to get done? Spring doesn't do REST, Jersey/JAX-RS does. You should have no problems using Spring's DI in your JAX-RS classes, if that's what you mean.


That's actually inaccurate. Spring MVC does do REST. Called Spring MVC REST. I find it much easier than JAX-RS. But that is my opinion.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 417
    
    4
OP,

Here is an example I once read:

http://www.mkyong.com/webservices/jax-rs/jersey-spring-integration-example/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jersey Based RestFul Web service integrated with Spring example Required