0
我使用Apache Tomcat v7.0.63,它承載4個不同的應用程序。其中一個應用程序具有錯誤頁面的列表。Apache Tomcat的錯誤頁面
現在我們想讓它成爲通用的,以便其他應用程序也可以使用相同的錯誤頁面。通過這種方式,我們不需要在所有Web應用程序中保留重複文件。我們希望將所有錯誤頁面保存在tomcat/errorPages目錄或tomcat/conf/errorPages目錄下。
我嘗試修改/tomcat/webapps/MyApplication/WEB-INF/web.xml文件,如下所示,它不起作用。任何人都可以幫忙嗎?
</error-page>
<error-page>
<error-code>404</error-code>
<location>/../../errorPages/errorPage404.html</location>
</error-page>
而errorPage404.html被放置在/ tomcat/errorPages目錄中。
嗨你檢查下面的解決方案 –
是。它不起作用。 1.我也驗證了文件權限。 2.我也嘗試過使用絕對路徑。 3.我也嘗試過使用regEx ..例如 /*file_not_found.html –
Vadiraj