Tomcat server modify the default encoding format

        When writing a website, the page passes parameters through the server, and sometimes the page or background appears garbled but cannot find the source (that is, when all the encoding formats of JSP, IDE, controller or servlet are UTF-8), you can consider whether it is the server. There is a problem with the encoding, and now the method to modify the default encoding format of the Tomcat server is given

        Find the conf folder in the Tomcat directory, open and edit the server.xml in it, and find it by searching

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

        A line of information, add an attribute URIEncoding="UTF-8", and add it as

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

        The default encoding format of the server is changed. Save and restart the server and try again. The problem may be solved

Note: Tomcat's original default encoding format is ISO8859-1

Guess you like

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