title: How to get url matching templates from a request context
body: <p>There are jersey-2 dynamically building endpoint RESTful resources.
  Path method</p>
  
  <pre><code>resourceBuilder.path("item/{id}");
  </code></pre>
  
  <p>defines a matching url pattern for a particular resource. E.g. when www.myapp.com/api/item/22 resource is requested, a handler with path pattern described above will process request.</p>
  
  <p>I need to find out which path pattern (here it's "item/{id}") the requesting call will match.   </p>
  
  <p>getMatchedResources() or getMatchedURIs() don't provide list of path patterns. </p>
  
  <pre><code>methodBuilder.produces(new MediaType("text", "plain"))
  .handledBy(new Inflector&lt;ContainerRequestContext, String&gt;() {
  
      @Override
      public String apply(ContainerRequestContext ctx) {
  
          List&lt;Object&gt; resources = ctx.getUriInfo().getMatchedResources();
          List&lt;String&gt; uris = ctx.getUriInfo().getMatchedURIs();
  
          return "Programmatically generated endpoint";
      }
  });
  </code></pre>
  
  <p>Did anyone solve similar problem? </p>