2017-06-13 20:33

@小王哥 $.ajax({
"type": 'POST',
//"contentType":'application/json',
"url": encodeURI(encodeURI(cxt + actionUrl)),
"data": {"data":JSON.stringify(jsonData)},
"async" : false,
"success": function(data){
if(data.status == 1){
window.location.reload();
}else{
$.messager.alert("提示", data.message);
}
},
"dataType": "json"
});
然后在服务端直接按照'data'的参数名称取出来的内容再进行反序列化成java对象

2017-06-13 20:31

@小王哥 解决了,用了一种折中的方法。
先把要发送的内容保存成JSON格式,比如
jsonData = {'appID':appID,'title':title,'type':type,'priority':priority,'content':content,'content_type':content_type,'isReceipt':isReceipt,midList:[mid]};
然后在用jquery的ajax方法

2017-06-07 22:37

请问jquery的ajax应该怎么写才可以用HttpKit.readData(getRequest());来读取json报文?我前端写出这都不出来
$.ajax({
"type": 'POST',
"url": 'xxxxxxxx',
"data": {'appID':appID,'title':title,'type':type},
"async" : false,
"success": function(data){
alert(data);
},
"dataType": "json"
});
是什么地方写错了吗?