Tomcat changes default encoding

By default, the encoding method used by tomcat: iso8859-1

Modify the conf/server.xml file under tomcat

Find the following code:    
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
This code specifies the port number and other information on which Tomcat listens for HTTP requests.

You can add an attribute here: URIEncoding, set the attribute value to UTF-8, and let Tomcat (default ISO-8859-1 encoding) process get requests in UTF-8 encoding.

After modification is complete:

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326944741&siteId=291194637