Using Tomcat+Apache, my web.xml's <welcome-file-list> is being ignored, and only Apache's DirectoryIndex is being used. Why?
I've got Apache 1.3.12 running with tomcat 3.2.1. In httpd.conf there is a DirectoryIndex like this:
DirectoryIndex index.cgi index.shtml index.html index.htm
In my web.xml file I have a welcome-file-list definition like this:
<welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.shtml</welcome-file> </welcome-file-list>
The reason is that Tomcat is not in charge of that process, since it is not the web server.
When you hit http://www.foo.com/ the web server on port 80 is taking care of redirecting you to the "index" page (a/k/a welcome file, a/k/a directory index) you've defined. In your case Apache will look for the list you've provided.
Try to shut down apache and use just tomcat, and you will see the <welcome-file-list> working.
[ The solution, then, is to add "index.jsp" to the front of the Apache DirectoryIndex line, like
DirectoryIndex index.jsp index.cgi index.shtml index.html index.htm
The new Tomcat connector, mod_webapp, is able to read web.xml directly, so it should (?) remove the need to have a separate DirectoryIndex line. -Alex]