servlet中文乱码问题

ml_zhu 12年前
1、post方式解决方案:
         request.setCharacterEncoding("utf-8");
     response.setCharacterEncoding( "utf-8" );

2、get方式
       String string = request。getParamers("");
        String = new String(string.getBytes("ISO8859-1","utf-8"));

3、修改tomcat的server.xml
          <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="utf-8"  />

4、修改tomcat的server.xml
          <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" useBodyEncodingForURI="true"  />
 
5、超链接也是get方式