Maven项目转移到Tomcat上时,怎样解决地址栏传中文乱码的问题?

tomcat做web服务器时,通过地址栏传中文参数时,为防止浏览器上的为乱码 
需在服务器server.xml中配置对应的端口中配置编码方式即可.例如:

    <Connector port="8080"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" 
               disableUploadTimeout="true"  useBodyEncodingForURI="true" URIEncoding="UTF-8"/>

中加入useBodyEncodingForURI="true" URIEncoding="UTF-8"就可以了.

posted @ 2015-01-01 12:27  seaiter  阅读(947)  评论(0编辑  收藏  举报