2013-02-08 55 views
0

我試圖覆蓋Tomcat的(第7版)默認歡迎文件列表,因爲它的conf/web.xml建議通過在下面聲明一個'welcome-file-list'標記形式我不能覆蓋Tomcat的默認歡迎文件列表

<welcome-file-list> 
     <welcome-file>estore.html</welcome-file> 
     <welcome-file>estore.htm</welcome-file> 
     <welcome-file>estore.jsp</welcome-file> 
</welcome-file-list> 

在我的應用程序的web.xml,但我得到這樣的錯誤:

HTTP狀態500 - 拋出java.lang.ClassNotFoundException: org.apache.jsp.estore_jsp

任何想法? 謝謝。

+1

您確定這些文件在WEB-INF/estore.html等文件中可用嗎? – Alfabravo 2013-02-08 16:19:09

+0

我剛剛將項目的web目錄中的index.jsp文件重命名爲estore.jsp – skiabox 2013-02-08 16:30:48

+1

如果您查看Tomcat上的webapps/yourapp文件夾,您是否確實看到了estore.jsp? – Alfabravo 2013-02-08 16:51:22

回答

1

我想試試這個:

<welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
</welcome-file-list> 
  1. 添加上面的代碼在你的web.xml

  2. 然後在index.html的,我會用<link />標籤轉發給我的期望登陸頁面,即你的情況estore.html。

這應該這樣做。

+1

覆蓋應該適用於給定的上下文,而不需要後面必須修復和記錄的黑客。 – Alfabravo 2013-02-08 16:53:55