Tomcat 自动上传的删除文件

解决方案:

在 sever.xml 中的 Context 中建一个虚拟路径,指定到服务器硬盘中的其他位置,比如放在 d: 的某个目录下。

同时可以将这个路径映射成为你当前工程名后面带个目录,比如说 /tsmart/control。

<Context path="/tsmart/control" docBase="d:/ttttt" />   

如果访问 http://localhost:8080/tsmart/control/xxxx.html 的话,实际上是访问 d:/ttttt/xxxx.html 中的内容。

总结:发布的网站最好不要放在tomcat目录下。

原文地址:https://www.cnblogs.com/peter-peng/p/4103569.html