I'm working with hstaudacher/osgi-jax-rs-connector and it also works fine but I
did not found the way to change the context path using Felix
| |
| | | | | | | |
| hstaudacher/osgi-jax-rs-connectorosgi-jax-rs-connector - An OSGi - JAX-RS 2.0
Connector, software repository available on the link below |
| |
| Afficher sur github.com | Aperçu par Yahoo |
| |
| |
Le Mercredi 3 juin 2015 15h51, Paul Bakker <[email protected]> a
écrit :
Mandatory, no; you can use another framework/your own implementation to work
with JAX-RS in OSGi. It is a very convenient way however, but as an Amdatu
developer I'm probably biased ;-) Take a look at the video and decide for
yourself.
Cheers,
Paul
On Wed, Jun 3, 2015 at 3:47 PM ismail berrada <[email protected]> wrote:
Thanks Paul for your answer. So does it means that I have to use Amdatu
component ?
Is it mandatory ? Is it the easiest way to do this ?
Regards
Le Mercredi 3 juin 2015 15h28, Paul Bakker <[email protected]> a
écrit :
Hi Ismail,
You can configure the root path using the "wink.rest.path" property for PID
"org.amdatu.web.rest.wink".
I will create an issue to also document this on the website, it seems to be
missing.
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
>
>