Tomcat中解决乱码问题

            第一种:(不建议使用)
                        new String(name.getBytes("ISO-8859-1"),"utf-8");
            第二种:(解决post方式提交乱码)
                         request.setCharaterEncuding("ntf-8");
            第三种:(解决get方式提交乱码)
                         在tomcat配置文件server.xml中加上URIEncoding="UTF-8"
                         <Connector port="8080" protocol="HTTP/1.1"
                          connectionTimeout="20000"
                          redirectPort="844                       
                          URIEncoding="utf-8"/>

原文地址:https://www.cnblogs.com/zyani/p/7270410.html