orderList = orderServiceImpl.queryOrderList(ownerId, null, null, null, null, null);
List<Map<String, String>> workers = new ArrayList<Map<String, String>>();
for(int i = 0;i < orderList.size();i++){
Map<String,String> order = new HashMap<String, String>();
order.put("description", orderList.get(i).getDescription());
order.put("name", orderList.get(i).getOwnerName());
System.out.println(orderList.get(i).getDescription());
order.put("type",orderList.get(i).getTypeName());
queryEvaluateList = orderServiceImpl.queryEvaluateListByUserId(orderList.get(i).getId());
order.put("comment", queryEvaluateList.get(0).getComment());
List<Allocation> allocation = orderServiceImpl.queryAllocationByOrderId(orderList.get(i).getId());
order.put("price", String.valueOf(allocation.get(0).getPrice()));
System.out.println(order);
workers.add(order);
}
//将map键值对转换成json,传给jsp
response.getOutputStream().write(JSON.toJSONBytes(workers));
}
以上这篇浅谈ajax在jquery中的请求和servlet中的响应就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持软件开发网。










