title: How to inject an object into jersey request context?
body: <p>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.</p>
  
  <p>Filter class</p>
  
  <pre><code>@Override
  public void filter(ContainerRequestContext request) throws IOException {
      MyObject obj = new MyObject();
      // Inject MyObject to request which I dont know how
  }
  </code></pre>
  
  <p>Resource Class</p>
  
  <pre><code>@PUT @Consumes("application/json")
  @Path("/")
  public String create(
          JSONParam sample,
          @Context MyObject obj) {
  
      System.out.println(obj.getName());
  
      return "";
  }
  </code></pre>