views:

133

answers:

1

Is it possible to access the Request object in a REST method under JAX-RS?

I just found out

[@Context][1] Request request;
+1  A: 

on JAX-RS you must annotate a Request parameter with @Context:

 @GET  
 public Response foo(@Context Request request) {  
 }

optionally you can also inject:

dfa