Hi Ismail, I just realise my answer is bogus. I thought your question was about Amdatu Web (which also uses JAX-RS), but you're asking about Jersey.
Amdatu Web does make it easier to work with JAX-RS in OSGi, so you might want to take a look at that anyway: http://amdatu.org/components/web.html Cheers, Paul On Wed, Jun 3, 2015 at 2:38 PM ismail berrada <[email protected]> wrote: > Hello, > I'm using Felix and I expose a REST web service using jersey framework > Everything works fine but every resources are accessible via the default > path i.e. services. > Each time I ask for a resource I send the following HTTP request template > > curl -v -X GET "http://localhost:8080/services/path/to/resource" > > Is there a way to change the default path ? I want to get my resources > from URL like > > http://localhost:8080/path/to/resource > > Please note that my service is not a servlet and I also have several > services!I tried to add properties to my service by adding a dictionnary > object when registering the service > Here is an extract of my Activator class > > [CODE] > @Override > public void start(BundleContext bundleContext) throws Exception { > try { > > Dictionary<String,String> properties = new Hashtable<String, String>(); > properties.put("root","/"); > > //.... > // Register web services > webServiceRegistration = > bundleContext.registerService(MyWebService.class, new MyWebService(), > properties); > > //..... > > } > catch(Exception ex){ > //handling ex > } > } > [/CODE] > > I can see in the web console that the service is registered and resources > are still availaible with the unwanted URL > > Regards > >
