【发布时间】:2014-06-02 08:21:03
【问题描述】:
我有一个 Tomcat 应用程序,它需要引用一些应用程序外部的属性文件。通常,这些存储在本地计算机上的特定位置,例如 C:\PROJECT_NAME\conf\。
在 Tomcat 7 中,这可以通过在 /META-INF/ 中放置一个 context.xml 文件来实现,该文件使用 VirtualWebappLoader 实质上将此位置添加到应用程序类路径中,如下所示:
<Context>
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="/PROJECT_NAME/conf"
searchVirtualFirst="true" />
</Context>
如何在 Tomcat 8 中实现同样的功能?
【问题讨论】:
标签: java tomcat classpath tomcat8