1.在js中将Action中响应的源码最新php源码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());
2024-11-20 19:34
2024-11-20 19:26
2024-11-20 18:51
2024-11-20 18:33
2024-11-20 18:00
2024-11-20 17:21