RESTful webservice : how to set headers in java to accept XMLHttpRequest allowed by Access-Control-Allow-Origin
Read here about your issue CORS : http://enable-cors.org/ Check if this one help you in your getMsg() method: return Response.ok(output).header(“Access-Control-Allow-Origin”, “*”).build(); If above doesn’t work try to add Jersey filter to your service. Create filter class: package your.package; public class CORSFilter implements ContainerResponseFilter { @Override public ContainerResponse filter(ContainerRequest creq, ContainerResponse cresp) { cresp.getHttpHeaders().putSingle(“Access-Control-Allow-Origin”, “*”); cresp.getHttpHeaders().putSingle(“Access-Control-Allow-Credentials”, … Read more