Search code examples
javaweb-servicesjax-rsstripes

Integrating WebService (JAX-RS) with Java Stripes


I have a web application developed in Stripes. Now I need to develop RESTful webservices (probably using JAX-RS) in the same app. How do I integrate my Stripes application to contain these webservices, is there any sample available, or any other method other than JAX-RS?


Solution

  • As Stripes is a web application framework (i.e., mainly presentation tier) whereas JAX-RS is a standard for doing RESTful web services (i.e., mainly business logic tier), I'd be strongly tempted to have two separate servlets, one for the Stripes part and one for the JAX-RS part. The Stripes part would then access the JAX-RS part for its back-end.

    It is probably possible to deploy both parts in the same container, but I've not a lot of experience with that.

    (You'll want to select which JAX-RS implementation you're using fairly early. The ones I know of are Jersey and CXF, and they have enough differences — driven from different sets of use cases — that you won't want to switch between them.)