JSP中get乱码

消除jsp中get方法传递中文参数的乱码问题

首先,进入tomcat目录(:/usr/local/jakarta-tomcat-5.0.28/conf)
sudo vim server.xml
在如下添加红色部分
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000"
               disableUploadTimeout="true" URIEncoding="UTF-8或GBK"/>
    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to 0 -->
保存,重启tomcat即可
注意
统一资源标识符 (Uniform Resource Identifier, URI)
统一资源定位符 (Uniform Resource Locator, URL)

你可能感兴趣的:(jsp)