hc6538 发表于 2017-1-23 07:43:55

tomcat中文路径问题

  主要是编码的问题,
因为Tomcat5的http Connector所用的URI解码默认用的是 ISO-8859-1,
而一般浏览器默认用的发送编码为UTF-8,这样问题就出现了,
初步的解决方法如下:
    在server.xml中类似如下配置:
    < Connector port="8080" maxThreads="150" minSpareThreads="25"
maxSpareThreads="75" enableLookups="false" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
disableUploadTimeout="true" URIEncoding="UTF-8" / >
   其中关键是 URIEncoding="UTF-8" 这项,其含义是指定URI的编码为:UTF-8
这样配置后重启Tomcat,基本能解决前面提到的中文路径和中文文件名问题。
页: [1]
查看完整版本: tomcat中文路径问题