SpringMVC receives garbled Chinese parameters

Solution:

1. Add tags to the jsp head

<%@ page contentType="text/html;charset=UTF-8"  pageEncoding="UTF-8" language="java" isELIgnored="false" %>

2. Tomcat encoding problem, label and add confthe server.xmlfile under the tomcat directory configured by idea , and then restart tomcat.修改ConnectorURIEncoding="UTF-8“

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

Guess you like

Origin blog.csdn.net/wlj1442/article/details/109161401