|
From: Alberto M. <ama...@gm...> - 2013-05-10 09:35:43
|
Hello, I'm working on this example. https://repository.cloudera.com/content/groups/cdh-build/org/jboss/resteasy/examples-jsapi/2.3.2.Final/examples-jsapi-2.3.2.Final.war Client javascript to resteasy with jsapi. ===================================================================== <html> <body> <h2>RESTEasy JS-API Demo</h2> <form> <input type='button' onclick='callJsApi();' value='Get Orders'/> </form> <script src="http://localhost:8080/examples-jsapi-2.3.2.Final/rest-js" type="text/javascript"></script> <script type="text/javascript"> var global_order_id = 0; function callJsApi() { var order = Orders.getOrder({id: global_order_id++}); alert(order); } </script> </body> </html> ===================================================================== If the html or jsp client, server is out of service rest. Returns this error in console javascript chrome: "XMLHttpRequest can not load http://localhost:8080/examples-jsapi-2.3.2.Final/resteasy/orders/5. Origin null is not allowed by Access-Control-Allow-Origin. clientAjax.html: 1 Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101 " works! if clientAjax.html this within the server. Please no way to configure the rest, to accept calls from outside the server? -- Alberto Saludos |