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:
@Cross
Remove annotation "@CrossOriginResourceSharing(allowAllOrigins = true)"
@CrossOriginResourceSharing(allowAllOrigins = true)
Then Return Response like below:
return Response.ok() .entity(jsonResponse) .header("Access-Control-Allow-Origin", "*") .build();
But the jsonResponse should replace with a POJO Object!
jsonResponse