apache源码路径
2024-11-25 01:24
1.在js中将Action中响应的源码短线操作指标源码怎么用List转换为json格式该如何做?
在js中将Action中响应的List转换为json格式该如何做?
List li=UserDAO.list();
JSONArray array = JSONArray.fromObject(li);
JSONObject object=new JSONObject();
try {
object.accumulate("list", li);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//array.add(object);
response.getWriter().write(array.toString());