在TOMCAT中request.setCharacterEncoding(encode)只能对POST方式的参数起作用,GET方式要靠server.xml中的URIEncoding来设置,URIEncoding="gb2312"时可以正确传输中文参数,但是文件名和路径不能用中文,URIEncoding="UTF-8"时可以使用中文文件名,却有无法GET中文参数,常用的转码没作用,真是郁闷!
RESIN就没这么讨厌的编码问题。

解决方案 »

  1.   

    tomcat的在线文档关于Connector有这样一个描述useBodyEncodingForURI 
    This specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding. This setting is present for compatibility with Tomcat 4.1.x, where the encoding specified in the contentType, or explicitely set using Request.setCharacterEncoding method was also used for the parameters from the URL. The default value is false. 
      

  2.   

    上面的文章我已经找到出处,就是看不大明白。
    http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
    我试着把它设置为true试试。