Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3663

How to handle CORS using JAX-RS with Jersey

$
0
0

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:

@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();}

As of now, i'm getting error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.”

Please assist me with this.

Thanks & RegardsBuddha Puneeth


Viewing all articles
Browse latest Browse all 3663

Trending Articles