title: Jersey resource class serving multiple paths
body: <p>I have written a resource class with which I want to support multiple resource paths.</p>
  
  <pre><code>@Path("/path/to/jobs")
  public class JobController {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public List&lt;JobDto&gt; getJobs() {
          ...
      }
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      @Path("{job_id}")
      public JobDto getJob() {
          ...
      }
  }
  </code></pre>
  
  <p>The problem is that this accepts the path <code>localhost:80/path/to/jobs</code>but not <code>localhost:80/path/to/jobs/job123</code>. I have tried annotating the class with <code>/path/to</code> and the methods with <code>jobs</code> and <code>jobs/{job_id}</code>. It still doesn't work. Any pointers?</p>
  
  <p>I found <a href="https://stackoverflow.com/q/4784028/341008" title="JAX-RS: Multiple paths">this</a> question and <a href="https://stackoverflow.com/q/21980244/341008" title="Using Single Jersey REST class for multiple PATH">this</a> which seem to suggest I should be able to do this.</p>