Java web项目中,通过get方式传中文参数时,获得的参数为乱码的解决方案

来源:互联网 发布:ntfs for mac在哪下载 编辑:程序博客网 时间:2024/06/03 00:43

在tomcat的配置文件server.xml文件中找到:

 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="utf-8"/>

增加 URIEncoding="utf-8"  ,使所传中文参数以utf-8格式编码。


0 0
原创粉丝点击