[PATCH] forward welcome files

2003-02-20 Thread Matt Parker
My last submission of this patch was heinously wrapped, and buried in a lot of discussion. This patch will: - check for the presence of a 'forwardWelcomeFiles' init param. if not present, it's false. - if 'forwardWelcomeFiles' is true, a request with a trailing slash that resolves to a welcome

Re: [PATCH] forward instead of redirect for welcome files

2003-01-07 Thread Matt Parker
On Tue, 2003-01-07 at 04:39, Remy Maucherat wrote: > Matt Parker wrote: > > 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 > > > &

Re: [PATCH] forward instead of redirect for welcome files

2003-01-07 Thread Matt Parker
On Tue, 2003-01-07 at 04:40, Remy Maucherat wrote: > I'll -1 this patch unless the new behavior is made optional (and default > to the current behavior). > > Remy Okay, it's now an init param which defaults to false. Following are DefaultServlet.java and web.xml patches. --- DefaultServlet.jav

RE: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
On Mon, 2003-01-06 at 18:31, Tim Moore wrote: > 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 f

RE: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
Here's the new version of the patch. the code to redirect if there is no trailing slash remains untouched, but it now forwards if there is a trailing slash. i've included more context to avoid potential confusion: --- DefaultServlet.java 2003-01-03 16:20:23.0 -0700 +++ DefaultServlet.java

RE: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
> 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

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
On Mon, 2003-01-06 at 17:11, Matt Parker wrote: > On Mon, 2003-01-06 at 17:03, Tim Funk wrote: > > If a trailing / is not present, then performing a > > RequestDispatcher.forward will break all relative references (for the > > web browser) > > > > -Tim > &g

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
> 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 > > okay, I was a little premature (no jokes please). if the welcome file itself has a relativ

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
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

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
On Mon, 2003-01-06 at 17:03, Tim Funk wrote: > If a trailing / is not present, then performing a > RequestDispatcher.forward will break all relative references (for the > web browser) > > -Tim > It doesn't forward until after it appends the trailing slash, so I think it's okay on that front.

RE: Unable to compile class for JSP

2003-01-06 Thread Matt Parker
Happy New Year :) On Mon, 2003-01-06 at 17:00, Gary Pollreis wrote: > will do - thanks for the heads up. > > -Original Message- > From: Matt Parker [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 5:57 PM > To: Tomcat Developers List > Subject: Re: Unable

Re: Unable to compile class for JSP

2003-01-06 Thread Matt Parker
you should post this to the tomcat-users list. this list is for issues related to development on the tomcat product. On Mon, 2003-01-06 at 16:48, Gary Pollreis wrote: > I have just installed Tomcat 4.1.18 under Windows 2000 (using Java JDK > 1.4.0). When I try to run the examples I get > "org.ap

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
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 a

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
On Mon, 2003-01-06 at 12:57, Costin Manolache wrote: > The problem is that once again the servlet spec defines a behavior that > is different from the common practices on web servers. > I don't see that this particular behavior is actually specified, unless I'm looking in the wrong place. I thi

Re: [PATCH] forward instead of redirect for welcome files

2003-01-06 Thread Matt Parker
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 prox

Re: [PATCH] forward instead of redirect for welcome files

2003-01-03 Thread Matt Parker
On Fri, 2003-01-03 at 17:14, Jon Scott Stevens wrote: > on 2003/1/3 4:03 PM, "Matt Parker" <[EMAIL PROTECTED]> wrote: > > > I'd like to suggest that catalina perform a forward, rather than a > > redirect, for requests that end with '/'. With a red

[PATCH] forward instead of redirect for welcome files

2003-01-03 Thread Matt Parker
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 t