简体   繁体   English

JAX-RS ajax问题

[英]JAX-RS ajax issue

I'm trying to call a JAX-RS webservice with ajax using jquery I encountred a vital problem that the invocation of the method has happened but the I can't get the data 我正在尝试使用jquery用ajax调用JAX-RS Web服务,我遇到了一个至关重要的问题,该方法的调用已经发生,但是我无法获取数据

    $.getJSON("http://192.168.1.2:9080/TestJMSWeb/jaxrs/categories/",function(data){
alert("success"+data);
});

this code should be executed on the phone with phonegap 此代码应在带有phonegap的手机上执行

the webservice is returning json array data I'm wondering why I can't get that data while the call is happining and I see the message of the exection of the method in the console. Web服务正在返回json数组数据,我想知道为什么在调用发生时无法获取该数据,并且在控制台中看到该方法执行的消息。 could you please tell me what should I do to fix my problem I'm very anxious and thanks in advance. 您能告诉我如何解决我的问题吗?我非常着急,在此先感谢。

"I can't get that data while the call is happining" - I am not sure what is the problem. “在通话过程中我无法获取这些数据”-我不确定是什么问题。 Maybe you problem is related to the fact that AJAX calls are asynchronous, so you need to wait for AJAX request returns back data from server. 也许您的问题与AJAX调用是异步的这一事实有关,因此您需要等待AJAX​​请求从服务器返回数据。 During the request you'll not see any data. 在请求期间,您将看不到任何数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM