2017-02-18 21 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