GET参数传输与中文路径问题

xiangbo520 2006-12-17 11:15:07
在TOMCAT中request.setCharacterEncoding(encode)只能对POST方式的参数起作用,GET方式要靠server.xml中的URIEncoding来设置,URIEncoding="gb2312"时可以正确传输中文参数,但是文件名和路径不能用中文,URIEncoding="UTF-8"时可以使用中文文件名,却有无法GET中文参数,常用的转码没作用,真是郁闷!
RESIN就没这么讨厌的编码问题。
...全文
267 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiangbo520 2006-12-19
  • 打赏
  • 举报
回复
上面的文章我已经找到出处,就是看不大明白。
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
我试着把它设置为true试试。
syoumei 2006-12-18
  • 打赏
  • 举报
回复
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.

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧