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目录下。

posted on 2014-11-17 14:50  peter.peng  阅读(460)  评论(0编辑  收藏  举报