tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Parker <>
Subject Re: [PATCH] forward instead of redirect for welcome files
Date Mon, 06 Jan 2003 19:36:32 GMT

On Mon, 2003-01-06 at 12:14, Hans Bergsten wrote:
> Matt Parker wrote:
> > I'd like to suggest that catalina perform a forward, rather than a
> > redirect, for requests that end with '/'. With a redirect, special
> > configuration is necessary for proxy servers to work correctly. Also, a
> > forward doesn't require an additional round trip to the client--a
> > redirect must get back to the client and the client then issues a new
> > request. I've tested this under Linux. Thanks!
> You mean requests that do _not_ end with '/', right? Unfortunatly,
> you must do a redirect in this case so that the browser can resolve
> relative paths in the page correctly. If you use a forward, it can't
> do so correctly.
> Hans

No, I mean requests that _do_ end with a trailing slash, but that should
be resolved to one of the files specified in the web application's
<welcome-file-list>. This is similar to Apache's DirectoryIndex
directive. Maybe the following Apache documentation snippet can explain
it more clearly than I can:

	"The DirectoryIndex directive sets the list of resources
	to look for, when the client requests an index of the directory
	by specifying a / at the end of the a directory name."

For Apache, this is index.html by default. When Apache receives a
trailing slash (e.g. /foo/bar/), it resolves index.html and returns it.
Note that it does _not_ send a redirect to index.html. The redirect
occurs only when there is no trailing slash at the end of a directory
request (e.g. /foo/bar is redirected to /foo/bar/, which is then
resolved to index.html)

So tomcat's behavior is actually going against what Apache does.

Hope I'm explaining it correctly.


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

View raw message