title: JAX-RS: OPTIONS for every Resource
body: <p>I am using a JAX-RS interface with XMLHttpRequest (XHR). Due to the XHR preflight, XHR send always OPTIONS before calling the real resource.</p>
  
  <p>Now I have dozens of methods and I need the OPTIONS for every resoruce. Is there any way to do this automatically? I dont want to write dozens of methods like:</p>
  
  <pre><code>@OPTIONS
  @Path("/{id}")
  @PermitAll
  public Response optionsById() {
      return Response.status(Response.Status.NO_CONTENT).build();
  }
  
  @OPTIONS
  @Path("/{id}/data")
  @PermitAll
  public Response optionsByData() {
      return Response.status(Response.Status.NO_CONTENT).build();
  }
  </code></pre>