不要直接返回String,而应该用HttpServletResponse直接writer
//不应该:
return "中文";
//应该:
response.setCharacterEncoding("UTF-8");
response.getWriter().write("中文");
不要直接返回String,而应该用HttpServletResponse直接writer
//不应该:
return "中文";
//应该:
response.setCharacterEncoding("UTF-8");
response.getWriter().write("中文");