Bug 9016 - welcome-files don't map to servlet without disk file
Summary: welcome-files don't map to servlet without disk file
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 4.1.24
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 8813 10116 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-12 23:11 UTC by Richard Gill
Modified: 2004-11-16 19:05 UTC (History)
2 users (show)



Attachments
Diff compared to the version used in TC 4.1.24 (5.83 KB, patch)
2003-03-30 00:59 UTC, Hans Bergsten
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Gill 2002-05-12 23:11:28 UTC
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
Comment 1 Remy Maucherat 2002-05-19 02:33:08 UTC
*** Bug 8813 has been marked as a duplicate of this bug. ***
Comment 2 Remy Maucherat 2002-06-21 13:37:52 UTC
*** Bug 10116 has been marked as a duplicate of this bug. ***
Comment 3 Hans Bergsten 2003-03-30 00:59:13 UTC
Created attachment 5564 [details]
Diff compared to the version used in TC 4.1.24
Comment 4 Hans Bergsten 2003-03-30 01:02:28 UTC
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.
Comment 5 Remy Maucherat 2003-03-30 07:35:48 UTC
I am against applying that patch to 4.1.x at this point in its lifecycle.
Comment 6 Remy Maucherat 2003-04-22 12:01:59 UTC
The issue has been resolved in Tomcat 5.0.x.