Server. xml and content. xml are automatically restored when Tomcat is configured. tomcat configures server. xml
When processing Chinese garbled characters or configuring data sources, we need to modify the server. xml and content. xml files under Tomcat.
However, when we restart the Tomcat server after modification, we find that the xml file has been restored, and the modification is ineffective.
Why is it restored?
When the Tomcat server is started in Eclipse, the project deployed in Eclipse will be automatically released, but my project is manually deployed outside, and Eclipse only recognizes the project deployed in it, therefore, it creates a new server. the xml file overwrites the original file, which contains only the projects deployed in Eclipse.
Solution 1:
Set Ecplise to cancel the auto release function.
Select Window-Preferences-Server-Launching, cancel Automatically publish wen starting servers, and click OK.
Solution 2:
The Ecplise project has a Server project and a Tomcat v7.0 Server at localhost-config,
There are also server. xml and content. xml, which are replaced with the modified file. When Tomcat is re-released, the configuration file here will be used to overwrite the files under conf in Tomcat.