过滤器filter_通过response返回JSON数据

response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
PrintWriter out = response.getWriter();
JSONObject res = new JSONObject();
res.put("msg", "错误");
res.put("success", "false");
out.append(res.toString());

参考文章:https://blog.csdn.net/u012201619/article/details/75156707/

你可能感兴趣的:(过滤器filter_通过response返回JSON数据)