前台: $.ajax({ type: 'POST', url: url, dataType: "json", success : function(data){ alert("success:"+data+"-"+data.length); }, error : function(mes){ alert("error:"+mes); } });
③返回字符串
List list = ……
String json = JSONArray.fromObject(list).toString();
response.setContentType("text/html;charset=utf-8");
response.getWriter().write(json.toString());

相关文章: