You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jan Grant <Ja...@bristol.ac.uk> on 2001/04/10 23:09:48 UTC

tomcat 3.2.1: blah/ => blah/index.jsp: how to prevent this?

Using tomcat 3.1, I could create an index.jsp file which would display
properly when the user requested the base directory.

Under tomcat 3.2.1, a request for "blah/" generates a 302 redirect to
"blah/index.jsp" rather than just serving up the content of index.jsp!

Is there any way to revert to the former (preferable) behaviour?

Cheers,
jan

PS. I'd appreciate a direct CC: on positive responses.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Ceci n'est pas une pipe |


Re: tomcat 3.2.1: blah/ => blah/index.jsp: how to prevent this?

Posted by Jan Grant <Ja...@bristol.ac.uk>.
I sent the original to tomcat-user but, on perusing the source, it
appears this list might be a better target.

On Tue, 10 Apr 2001, Jan Grant wrote:

> Using tomcat 3.1, I could create an index.jsp file which would display
> properly when the user requested the base directory.
>
> Under tomcat 3.2.1, a request for "blah/" generates a 302 redirect to
> "blah/index.jsp" rather than just serving up the content of index.jsp!
>
> Is there any way to revert to the former (preferable) behaviour?

Hmm, looking closer it seems that according to
org/apache/tomcat/request/StaticInterceptor.java,

        // Send redirect to the welcome file.
        // This is consistent with other web servers and avoids
        // gray areas in the spec - if the welcome file is a jsp,
        // what will be the requestPath - if it's the dir, then
        // jasper will not work. The original code created a
        // RequestDispatcher and the JSP will see an included
        // request, but that's not a specified behavior

I don't think that "behaving like other web servers" in this respect -
especially when it comes to a grey area of the spec - is a very good
idea... See
	http://www.w3.org/Provider/Style/URI
(item labelled "software mechanisms" in particular)

Currently, it appears that if I wish to avoid broadcasting my use of
JSPs, I've just got to code servlets and use those instead. This isn't
particularly satisfactory.

What's the likelihood of revising this decision?

Cheers,
jan

PS. I'd appreciate a direct CC: on any responses.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Scrabble gematria: "BIBLE" = "DOGMA"