@RequestMapping("/queryServerList/{code}")
问题:前台传入的code为中文,但是在后台接收到的确实中文乱码。
解决方案:试了很多方法,我介绍一下最后起作用的办法。
在tomcat的server.xml文件中,修改如下:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
就是在最后加上:URIEncoding="UTF-8"。
问题解决。