jQuery的Ajax接收java返回数据方法
1.前端Ajax请求如下:
$.ajax({
type : "post",
//async:false,
url : PATH + "/product/selectPicture.action",
dataType : "json",
success : function(data) {
$.each(data,function(k,v){
alert(k +":"+ v);
});
}
});
2 其中PATH在jsp页面中定义:
<%
String path=request.getContextPath();
%>
2.1 后端java代码输出json格式数据:
List