tomcat访问软链接

2020-07-15  本文已影响0人  su10m

问题:

tomcat的webapps目录下,是项目相关文件,有时需要访问软链接,(比如上传附件功能,需要把附件保存到webapps目录以外,项目访问时可以通过软链接形式)但tomcat默认不支持项目访问软链接

解决方案:

修改conf/context.xml文件

(1)tomcat8之前版本

<Context allowLinking="true"></Context>

(2)tomcat8开始

<Context>

    <Resources allowLinking="true" />

</Context>

以上

上一篇 下一篇

猜你喜欢

热点阅读