When I view the tomcat source code at http://grepcode.com/file/repo1.maven.org/maven2/org.apache.tomcat/tomcat-catalina/7.0.0/org/apache/catalina/connector/Request.java#Request.parseParameters%28%29
I can't find where to set encoding for the queryString which comes from get method and how does the configuration URIEncoding="UTF-8"
in server.xml
work in this method.
相关问题
- Angular RxJS mergeMap types
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Tomcat and SSL Client certificate
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- Is a unicode user agent legal inside an HTTP heade
- git: retry if http request failed
The
URIEncoding
parameter is what you're looking for. It sets the character encoding to be used when URI decoding the query string.You use it in
server.xml
as an attribute of theConnector
entity.If successfully used it in the past.
First, let's use a more recent version of Tomcat. 7.0.0 is years old: Request.java from Tomcat 7.0.34
Second, the
parseParameters
method does not set the encoding: it fetches the encoding which has been set by other components. Some places where the content encoding might have been set:If you just want to set the URI encoding to UTF-8 unconditionally across your site, then just use the
URIEncoding
attribute in your<Connector>
.The direct answer to your question is that server.xml's
URIEncoding
attribute does not work in this method: it works elsewhere.