title: How to handle CORS using JAX-RS with Jersey
body: <p>I'm developing a java script client application, in server-side I need to handle CORS, all the services I had written in JAX-RS with JERSEY.
  My code:</p>
  
  <pre><code>@CrossOriginResourceSharing(allowAllOrigins = true)
  @GET
  @Path("/readOthersCalendar")
  @Produces("application/json")
  public Response readOthersCalendar(String dataJson) throws Exception {  
       //my code. Edited by gimbal2 to fix formatting
       return Response.status(status).entity(jsonResponse).header("Access-Control-Allow-Origin", "*").build();
  }
  </code></pre>
  
  <p>As of now, i'm getting error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8080">http://localhost:8080</a>' is therefore not allowed access.”</p>
  
  <p>Please assist me with this.</p>
  
  <p>Thanks &amp; Regards
  Buddha Puneeth</p>