On Wed, 3 Oct 2001, Jan Grant wrote:

> Date: Wed, 3 Oct 2001 13:59:10 +0100 (BST)
> From: Jan Grant <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: tomcat-dev <[EMAIL PROTECTED]>
> Subject: welcome files being forwarded to rather than redirected to?
>
> A while ago I sent a message about the behaviour of welcome files going
> against the recommendations at http://www.w3.org/Provider/Style/URI; at
> the time the servlet spec was in PFD and was fairly explicit that
> sending a redirect wasn't acceptable.
>
> Looking at the final spec, it appears that they've toned down their
> language a little - nevertheless, this kind of behaviour (avoiding
> redirects) seems preferable.
>
> Unfortunately, the latest stable tomcat/catalina (congrats on this, by
> the way!) still behaves in the old way.
>
> I know I can explicitly map any URIs to particular JSPs or html files;
> however, I'd like to avoid having to do that (the convenience of welcome
> files is completely lost).
>
> Is this set in stone?
>

It's not at all clear that the "Persistent URI" article you referenced has
anything to do with whether a redirect is used for a welcome file or not
 (the original persistent URI that the *human* used is still the same,
no matter what technology is used on the server end) ... but there is a
practical reason for the current behavior as well.

Originally (back in the pre-3.2-final days), Tomcat did the equivalent of
a RequestDispatcher.forward() to display welcome pages.  This caused
massive problems for people who didn't understand the difference between:

  http://foo.bar/webapp

and

  http://foo.bar/webapp/

In the former case, any relative urls on the "real" welcome page are
broken.  This caused bug reports about welcome files not working (never
mind that using a <base> element in your welcome page would have fixed
it), which led to the current behavior.


> Cheers,
> jan
>

Craig


> PS. original message here:
>       http://w4.metronet.com/~wjm/tomcat/2001/Apr/msg00234.html
> - in a nutshell: if I request http://foo.bar/webapp/
> I'd like to see the contents of .../webapp/index.html, but _not_ see a
> redirect to http://foo.bar/webapp/index.html
>
>
> --
> jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
> Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 [EMAIL PROTECTED]
> ( echo "ouroboros"; cat ) > /dev/fd/0 # it's like talking to yourself sometimes
>
>

Reply via email to