How to inject an object into jersey request context?
问题 I have this scenario where I want to write a filter and I want this filter to insert some object into the current request and pass it on so that when the resource class gets the request it can use the object. Filter class @Override public void filter(ContainerRequestContext request) throws IOException { MyObject obj = new MyObject(); // Inject MyObject to request which I dont know how } Resource Class @PUT @Consumes("application/json") @Path("/") public String create( JSONParam sample,