In order to have a webapp load a particular servlet as the default, I am using a <welcome-file> directive, and then a <servlet-mapping> to direct that to the appropriate servlet. However, this only works if there is a physical file in the directory with the name of the welcome file. Rather strange behaviour as the file is not actually used. The following is used to make the request go to our servlet, but all requests for images, etc, go to the tomcat default servlet. In the WEB.XML: <servlet-mapping> <servlet-name>servlet1</servlet-name> <url-pattern>/index.html</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> My configuration: Tomcat 4.03 Final JDK 1.4.0 Windows 2000
*** Bug 8813 has been marked as a duplicate of this bug. ***
*** Bug 10116 has been marked as a duplicate of this bug. ***
Created attachment 5564 [details] Diff compared to the version used in TC 4.1.24
The attached diff solves this problem. It also changes how welcome files are handled in general, so that the resource mapped to the welcome pattern is invoked directly instead of invoking the default servlet and having it redirect to the resource.
I am against applying that patch to 4.1.x at this point in its lifecycle.
The issue has been resolved in Tomcat 5.0.x.