1:如果只是页面展示可用:
req.setCharacterEncoding("utf-8"); resp.setCharacterEncoding("utf-8"); resp.setContentType("text/html;charset=utf-8;");
2:传递的参数乱码,一般可用转码和解码:
URLEncoder.encode("中文");
URLDecoder.decode("中文");
原文:https://www.cnblogs.com/nuyan/p/14552050.html