版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28643437/article/details/81974440
List<HashMap<String, Object>> mapList= new ArrayList<HashMap<String, Object>>();
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF8");
PrintWriter writer = response.getWriter();
writer.write(JSON.toJSONString(mapList));
writer.close();