tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: [PATCH] forward instead of redirect for welcome files
Date Mon, 06 Jan 2003 21:43:54 GMT
Matt Parker wrote:
> 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.

Okay, that's different. Maybe I misread your patch, but to me it looked
as if you changed the behavior when there's no trailing slash.

Anyway, I leave it to Costin to decide if it can be applied safely or
not.

Hans
-- 
Hans Bergsten                                <hans@gefionsoftware.com>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message