I am using a JAX-RS interface with XMLHttpRequest (XHR). Due to the XHR preflight, XHR send always OPTIONS before calling the real resource.
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:
@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();
}