After Tomcat deploys the service, the problem of garbled characters is dealt with
Tomcat small window garbled and log garbled problem handling
After Tomcat starts the project, if it is not configured, there may be garbled characters in the Tomcat small window, which affects everyone's viewing of logs. At this point we can modify the logging.properties file under the tomcat package
.
After deploying the project, the problem of program garbled characters is dealt with
During program deployment, if there is a program garbled problem solution:
1. Modify the server.xml file in the conf package under Tomcat, and add the encoding rules as shown in the figure
2. In the case that the first setting still cannot solve the problem, we can modify the catalina.bat file in the bin package in Tomcat, add a -Dfile.encoding=UTF-8
statement, and add the following location:
set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS%" -Dfile.encoding=UTF-8
The second solution is only applicable to individual problems. If the second solution cannot be solved, you can use the third solution.
3. When the previous two solutions still cannot solve the problem of garbled characters on the front-end page, you can add an environment variable to the environment variable. The name of the environment variable is: JAVA_TOOL_OPTIONS
, and the value is: -Dfile.encoding=UTF-8
as shown in the figure below:
This method can basically solve most of the garbled characters of the tomcat startup service. If you have a new solution, please communicate with us.