日期:2014-05-16 浏览次数:20410 次
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script> function test(){ var url = "/donategroup/queryMemberDonate.action"; $.getJSON(url, function(json){ alert(json);//json是一个json数组 for(var i=0;i<json.length;i++){ alert(json[i]); alert('amount:'+json[i].amount); alert('bankName:'+json[i].bankName); alert('memberId:'+json[i].memberId); } }); }
List<MemberDonateRecord> memberdonaterecord=donaterecordservice.queryMemberDonate(memberId,requestId,page,size,name,beginDate,endDate); JSONArray ja = JSONArray.fromObject(memberdonaterecord); ServletActionContext.getResponse().setCharacterEncoding("UTF-8"); final PrintWriter out = ServletActionContext.getResponse().getWriter(); out.write(ja.toString());