Ajax request with JAX-RS/RESTEasy implementing CORS
I have two servers (Apache and JBoss AS7) and I need to provide access to all http methods to a client. All these request must be sent via ajax. Example of the client code: $.ajax({ type: "get", url: "http://localhost:9080/myproject/services/mobile/list", crossDomain: true, cache: false, dataType: "json", success: function(response) { console.log(response); }, error: function (jqXHR, textStatus, errorThrown) { console.log(textStatus); console.log(jqXHR.responseText); console.log(errorThrown); } }); In JBoss AS7 I'm using RESTEasy, implementing CORS as follows: @Path("/mobile") @Provider