tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Moore" <>
Subject RE: [PATCH] forward instead of redirect for welcome files
Date Tue, 07 Jan 2003 01:31:22 GMT
> -----Original Message-----
> From: Matt Parker [] 
> Sent: Monday, January 06, 2003 8:11 PM
> To: Tomcat Developers List
> Subject: RE: [PATCH] forward instead of redirect for welcome files
> > If you want to mirror what Apache HTTPD does:
> > 
> > No slash present --> append slash (only!) and redirect
> > Slash present --> internally forward to welcome-file page
> Well, here's the rub:
> - The new servlet spec clearly states that either /foo or 
> /foo/ should return a welcome-file (if specified)

Well if you redirect from /foo to /foo/ and handle the welcome file from
/foo/ then all is well. :-)

> - Apache also has the problem with a relative link on a 
> welcome file which has a directory specified in it

Ah...yes I imagine so.

> However, I think that the patch benefits still outweigh its drawbacks:
> - it satisfies the new servlet spec
> - it circumvents the need for special processing and 
> configuration when placed behind a proxy server (a farely 
> common production practice).
> - it inherits a problem, but the problem is probably rare in 
> practice, and will already have been avoided by Apache users 
> since it's the same. i.e. i've never had a burning need to 
> specify a welcome file or directory index that has a 
> subdirectory in it _and_ has a relative link, so i can only 
> guess that others either don't or already know to avoid it.

Unless I'm missing something, if you don't redirect from /foo to /foo/,
then you'll have broken relative links even if the welcome file is not
in a subdirectory.  This would probably be a pretty common problem.

For example, if your welcome file has <a href="bar.html"> then resolving
that relative to /foo would give you "/bar.html" while resolving it
relative to "/foo/" would give you "/foo/bar.html".  That means that
relative links will either work or not work, depending just on whether
the trailing slash is there.
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message