![](/img/trans.png)
[英]i m trying to get response from server and retrieving it using JSON. java.lang.string cannot be convert into jsonObject
[英]I am doing a JSONP call to backend from javascript function in order to get the response data in json. How to do this from java end?
我正在使用ajax从javascript触发以下跨域JSONP调用:
$.ajax({
url: 'https://xyz.abc.com/xxx/xxx/client',
type: 'POST',
dataType: 'jsonp',
jsonpCallback: 'callback',
data:{ id: '123456' },
crossDomain: true,
contentType: 'application/jsonp'
});
以下是从网络标签中看到的查询字符串参数:
callback=callback&id=123456&_=1498907401152
但是由于安全性和防止漏洞的原因,我想从Java端进行此调用。 我如何从Java端进行上述发布的等效JSONP调用? 我正在使用Struts2动作类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.