public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException{
JSONObject json = new JSONObject();
json.put("data1", "1233");
json.put("data2", "2344");
ServletOutputStream os = resp.getOutputStream();
os.write(json.toString().getBytes());
os.flush();
os.close();
}
list转JSON时需要用循环进行处理,并将对应的KEY写入到JSON中