# doPost方法中解决乱码
## request.setCharacterEncoding("UTF-8");
## 必须在所有获取数据的动作之前设置
# doGet方法中解决乱码
## tomcat8及之后,不用设置编码
## tomcat8之前:比如String name = request.getParameter("name"),name是乱码,则:
## byte[] bytes = name.getBytes("ISO-8859-1");
## name = new String(bytes, "UTF-8");
标签:name,##,bytes,乱码,String,解决,servlet,tomcat8 From: https://www.cnblogs.com/guoxingyu/p/16897717.html