tomcat get post 乱码解决办法URIEncoding="UTF-8"

来源:互联网 发布:鼠标自动移动软件 编辑:程序博客网 时间:2024/04/29 22:21

tomcat开发中,使用get方法传参含汉字时,可能会出现乱码的问题。

解决方法:

1、设置tomcat服务器中的参数为utf-8类型

tomcat\conf\server.xml中找到:
<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443"/>
改成:
<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443"  URIEncoding="UTF-8"/>

1 0
原创粉丝点击