users@jersey.java.net

Is HttpServletRequest always null using HttpServer?

From: Zach Cox <zcox522_at_gmail.com>
Date: Wed, 14 May 2008 13:33:30 -0400

I'm new to Jersey, just playing around to learn more (using 0.8). I'm
currently just using the simple HttpServer to launch my little test
app:

HttpServer server = HttpServerFactory.create("http://localhost:9998/");
server.start();

I then have a resource class that gets a HttpServletRequest field injected:

@Path("something")
public class MyResource
{
    @Context
    HttpServletRequest request;
}

That request field is always null. Is this just an effect of using
HttpServer and not using a proper container like Jetty or Tomcat? Or
am I doing something wrong?

Thanks,
Zach