response 返回json字符串

版权声明:本文为博主原创文章,未经博主允许不得转载。 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();

猜你喜欢

转载自blog.csdn.net/qq_28643437/article/details/81974440
今日推荐