Tomcat中间件URL中文字符传递问题

时间:2022-03-08 08:56:20

1. 问题描述:

tomcat中如果URL中需要传递中文参数,需要配置tomcat的service.xml中文传递的编码方式,否则中文传递将出现乱码,导致程序异常。

2. 解决方式:

修改tomcat配置文件:

修改tomcat配置文件service.xml:URIEncoding="UTF-8"
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>