tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Parker <mp...@voyanttech.com>
Subject Re: [PATCH] forward instead of redirect for welcome files
Date Tue, 07 Jan 2003 00:30:04 GMT
On Mon, 2003-01-06 at 15:28, Costin Manolache wrote:
> Matt Parker wrote:
> 
> > On Mon, 2003-01-06 at 14:43, Hans Bergsten wrote:
> >> 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.
> > 
> > Actually my patch is forwarding under both circumstances, but according
> > to SRV.9.10 of Servlet 2.4, this is actually correct (phew! :)
> 
> Forwarding if there is no ending "/" doesn't seem right. I'm very sure 
> anchors will be broken.
> 

The code to append a trailing / before it does anything else (assuming
it's a directory) is already present in the default servlet--my patch
forwards after this happens. Maybe I should have included more context
within the patch to make this clearer--sorry, I can see why this would
be so controversial without that key point. Otherwise it would
definitely break. The patch occurs after the line:

if (resourceInfo.collection) {
...
}

which means that it has already ruled that the request is a directory.

> It may be a good idea to include a modified patch that makes this optional -
> but IMO redirect should remain the default. But please verify that anchors
> work, including cases where the welcome file is in another directory.
> 

Verified the following:

http://foo/bar#anchor
http://foo/bar/#anchor

with a welcome-file of:
test/test.jsp

and was correctly forwarded to:

http://foo/bar/test/test.jsp#anchor


Matt




--
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