This example demonstrates how to develop a simple OSGi WAR bundle containing a RESTful hello world web service
The example WAR (see the war-bundle module) consists of two Jersey resources:
com.sun.jersey.samples.helloworld.HelloWorldResource
com.sun.jersey.samples.helloworld.AnotherResource
The mapping of the URI path space is presented in the following table:
URI path | Resource class | HTTP methods |
---|---|---|
/helloworld | HelloWorldResource | GET |
/another | AnotherResource | GET |
To run the example, you would need to build the WAR file and install it to an OSGi runtime (e.g. Apache Felix) together with other OSGi modules. Look at the attached functional-test module for details on the programatical runtime configuration. To build the war archive and run the tests, you can just launch
%mvn clean install