有4個地方上下文可以住。
- tomcatdir/CONF/server.xml中
- tomcatdir/CONF/context.xml中
- tomcatdir/CONF /卡塔利娜/本地主機/ appname.xml
- tomcatdir/web應用/應用程序的名字/ META-INF/context.xml
如果是tomcat 8,allowlinking屬性應該在Context中指定而不是在Resources標籤中指定。我tomcatdir/conf/context.xml文件看起來像這樣
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="100000" />
</Context>
該解決方案對我來說,現在工作得很好。但是我想分享一下我在進入這個解決方案之前所犯的錯誤。
我已經在tomcatdir/conf/server.xml和tomcatdir/conf/context.xml中定義了資源。 allowLinking =「true」僅在tomcatdir/conf/server.xml中設置。
我發現的是,如果你沒有指定allowLinking,它就等於將它設置爲false。所以我從server.xml中刪除了Resources標籤,並且只留下了tomcatdir/conf/context.xml中的allowLinking =「true」屬性。
是的,所有我所要做的就是創建一個context.xml文件: 在/ var/lib中/ TOMCAT5/webapps /下測試1/META -INF/context.xml 該鏈接非常有幫助。謝謝。 – 2008-11-24 19:58:04
謝謝你。任何想法如何配置tomcat(6)始終遵循符號鏈接? – 2008-11-25 21:09:14