dev@jersey.java.net

Re: [Jersey] null pointer exception on resource class access HttpServletRequest?

From: James Russo <jr_at_halo3.net>
Date: Wed, 21 Apr 2010 15:05:39 -0400

>
> By class variable do you mean field of a class? then no. You can do this:
>
> @Component
> @Scope("singleton")
> public class MyBean {
> @Context HttpServletRequest r; // thread local proxy is injected
>
>
> @GET
> public ... getIt(@Context HttpServletRequest r /* Independent of class scope*/)
> { ... }
> }
>

I guess I don't follow how the thread local proxy injection works. Do you need to access this field via the accessor methods then? Can you point me to a reference explaining how that works?

thanks,

-jr