tags:

views:

16

answers:

0

Hi,

trying to get the hang of Jersey With a very basic example. Say I have an interface:

public interface MyApp {
    String getName(int id);
}

and a class to be mapped with jersey:


@Path("/app/{id}")
public class MyServlet {
  private MyApp myApp;
  @GET
  @Produces("text/plain")
  public String getName(@PathParm("id") int id)
  {
    return myApp.getName(id);
  }
}

now, all i'm trying to do is work out how to link an instance of MyApp into this servlet. It's probably the simplest thing out there, but I just haven't found a simple example... the only clue I found was here: http://weblogs.java.net/blog/mhadley/archive/2007/09/integrating_jer.html

thanks