Hi!
I modified one of the examples enclosed with
JBoss RESTEasy and here is an example of a method in a REST resource that can access the HttpServletRequest object related to the incoming request:
By annotating a method parameter, you assure yourself that the request object is obtained in connection to processing a request.
I had a case once where injection into an instance field resulted in one single dependency injection, which very soon became stale.
To see what kind of objects you can have injected into a resource class using the @Context annotation, see section 6.1 (if I remember correctly) of the JAX-RS specification.
Best wishes!