• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Jersey Based RestFul Web service integrated with Spring example Required

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Maya sekar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OP,

Here is an example I once read:

http://www.mkyong.com/webservices/jax-rs/jersey-spring-integration-example/
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic