net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(list);
response.setContentType("text/html; charset=UTF-8");response.getWriter().print(jsonArray);
这里需要导入的包有:
import net.sf.json.JSONObject;
需要的jar包有:json-lib-2.3-jdk15.jar
net.sf.json.JSONArray jsonArray = net.sf.json.JSONArray.fromObject(list);
response.setContentType("text/html; charset=UTF-8");response.getWriter().print(jsonArray);
这里需要导入的包有:
import net.sf.json.JSONObject;
需要的jar包有:json-lib-2.3-jdk15.jar