I think Im going insane, but I cannot get a simple default index.html page to display in jetty.
the root context defined in the web.xml is
<servlet-mapping>
<servlet-name>jersey-servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
and I have welcome file as:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
But upon entering http://localhost:8182/api/ i get a 404. This works FINE in tomcat so what am I missing??????????? Am doing something dumb I know but still…works on tomcat.
thanks
There isn’t enough information in your question to be 100% sure, but I suspect you’re running into problem that “welcome files need to actually exist”.
This page provides more details, including how to overcome the problem:
http://web.archive.org/web/20150520205320/https://docs.codehaus.org/display/JETTY/Welcome+files+not+working
The short explanation is that, by default, this version of Jetty will not treat a servlet as matching a welcome-file unless an actual file also exists.
The reason for this, is that JSPs are implemented as a servlet, and if Jetty matched welcome files just because there was a servlet-mapping match, then
index.jspwould always match as a welcome file, but you only want that to happen if there really is anindex.jspfile.