Tag Archives: TomcatJSON parse error

TomcatJSON parse error: Invalid UTF-8 [How to Solve]

After deployment on the server, it is found that many places report 400 error, which has a unified feature of transmitting Chinese to the back-end interface

Solution:

1. configure the Tomcat server transmission encoding format specification:

Edit the tomcat/conf/server.xml file and add the encoding attribute: URIEncoding=”UTF-8″ to the Connector tag

2. Edit the tocmat/bin/catalina.bat file and add the following attribute: set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8

3. the most important step is to restart through shutdown and startup under the bin directory of Tomcat