How to inject an object into jersey request context?
You could just use ContainterRequestContext.setProperty(String, Object). Then just inject the ContainerRequestContext @Override public void filter(ContainerRequestContext crc) throws IOException { MyObject obj = new MyObject(); crc.setProperty(“myObject”, myObject); } @POST public Response getResponse(@Context ContainerRequestContext crc) { return Response.ok(crc.getProperty(“myObject”)).build(); } Another option to inject the MyObject directly is to use the HK2 functionality Jersey 2 offers. Create a … Read more