users@jersey.java.net

[Jersey] Re: How to configure a _at_Path resource

From: Martin Matula <martin.matula_at_oracle.com>
Date: Tue, 10 May 2011 15:38:00 +0200

You can use subresource locator. Like this:

@Path("/")
public class RootResource {
     @Path("foo")
     public Foo getFooImpl() {
         // decide which impl. of Foo you want to return
         ....
         return new FooImplX();
     }
}

On 9.5.2011 19:51, Chris.Rowland_at_sungard.com wrote:
>
> I just started playing around with Jersey, and I tried to find this in
> the documentation, but I haven’t seen it so far.
>
> I’m curious what the correct way to configure a @Path annotated
> resource is.
>
> Basically I want to inject an implementation of an interface at
> runtime… something like this:
>
> @Path(“/foo”)
>
> Public class Foo {
>
> public void setHandler(IHandler h) {
>