Adam James
Adam James

Reputation: 4191

404 when setting up Eclipse Dynamic Web Application

This is the first time I have ever tried to set up a web application project on my own and for some reason I can't even get it to work with a hello world setup. I have everything set to default, the JDK1.8 selected for compiling and an Tomcat7 server with a index.html page that has only text in it. I should be able to right click on the projet and Run on Server after adding the project to the server but I keep getting a 404 even with this simple setup. What am I missing?

Setup

Web.xml welcome list:

<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>

Upvotes: 1

Views: 3794

Answers (1)

wittakarn
wittakarn

Reputation: 3164

You cannot access files under WEB-INF folder directly. Container will look for classes in WEB-INF/classes and jsp files under WEB-INF can be included by other JSP, but any browser requesting resources down there will get a 404 response.

You should change index.xhtml path from webapp/WEB-INF/index.html to webapp/index.html for corresponding to your web.xml

Upvotes: 7

Related Questions