2017-02-18 19 views
0

這是一個非常常見的問題,但我無法找到它的解決方案。 我在Eclipse中創建了一個Dynamic Web Project。它是一個沒有Java文件的空項目。每當我嘗試在Tomcat服務器上運行它時,它都會給我提供HTTP狀態404錯誤:未找到請求的資源。 這是歡迎頁面的index.html是裏面的WEB-INF文件夾和web.xml的內容如下無法使用Tomcat啓動歡迎頁面

<welcome-file-list> 
<welcome-file>index.html</welcome-file> 
<welcome-file>index.htm</welcome-file> 
<welcome-file>index.jsp</welcome-file> 
<welcome-file>default.html</welcome-file> 
<welcome-file>default.htm</welcome-file> 
<welcome-file>default.jsp</welcome-file> 
</welcome-file-list> 
</web-app> 

回答

0

index.html應該在web項目的根文件夾,旁邊WEB-INF文件夾。所以,在Eclipse中,文件夾結構應該看起來像下一個:

MyEclipseProject 
    ... 
    WebContent 
     index.html 
     ... 
     WEB-INF 
      web.xml