tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <>
Subject Re: http 302 issue on tomcat 4.0.1
Date Tue, 04 Jun 2002 18:41:42 GMT
> if matchingWelcomeFile.contains("/"):
>   # psycopathic case no one cares about ( ie. welcome file is a/b.jsp )
>   redirect, old style //we show the filename here, but if we didn't we'd
> break relative paths
> else:
>   if path.endsWith("/"):
>     # happy, smiley family case
>     redispatch, using welcome-file full path (ie. /foo/index.jsp ) for
> security checking

This redirect may cause problems, because it will happen regardless of
whether or not the path exist (or it makes sense to redirect).

You have index.jsp and index.html in the welcome files. No matter what you
the request will always be redirected to Jasper, which will always return a
404. Checking for the presence of the physical file won't work either
(you could have a *.do mapping like Struts uses).

Any idea to avoid that problem ?

Also, the changes are going to make the mapping slower. I plan to refactor
operation (use an automaton and bytes instead of String manipulations) in
next major version of Tomcat, which should help tremendously, but until
then ...

>   else:
>     if adding slash causes a servlet mapping match:
>       # we handle the stupid case of having two servlet mappings
>       # ( /foo and /foo/ ) in web.xml.
>       redirect, old style //we show the filename here, but if we didn't
> we'd call the wrong servlet
>     else:
>       redirect, adding "/" ( ie. redirect /foo to /foo/ )


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message