tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: [5.0] [PROPOSAL] Refactored mapper
Date Fri, 16 Aug 2002 15:29:02 GMT
Bob Herrmann wrote:
> On Thu, 2002-08-15 at 15:37, Remy Maucherat wrote: 
> [...] 
> 
>>Yes, but welcome files for non physical resources cannot be implemented 
>>(since you have no way of asking a servlet if it can or cannot process a 
>>resource).
>>I'll implement something which works and which is very close to what the 
>>spec requires.
>>
>>Again, I have sent many messages to the spec leads about this issue 
>>without any result, so I give up ...
> 
> 
> I don't completely understand the issue(s), but consider this, 
> 
> <servlet-mapping> 
>    <servlet-name>BooServlet</servlet-name> 
>    <url-pattern>/*.boo</url-pattern> 
> </servlet-mapping> 
> 
> <welcome-file-list> 
>    <welcome-file>index.jsp</welcome-file> 
>    <welcome-file>index.boo</welcome-file> 
> </welcome-file-list> 
> 
> Is the problem that by the time the 'welcome file logic' gets a chance
> to handle the request, the logic that would have been able to pass this
> request off to a servlet is way too far up the call stack?    It is
> almost like the DefaultServlet would need to open a connection to the
> loopback and check each "welcome file" URI to find one that gets to
> something useful (this is just a mental exercise, don't get excited I
> wouldn't think of implementing this.)

It means that in that case, no matter what the URL is (as long as it 
ends with a '/'), it will end up to your_url/index.boo, which isn't good 
since it may be completely stupid (and your other entries in the welcome 
file list would get ignored), unless you have a way to verify that it is 
intelligent to forward to index.boo (it's easy to do for physical files, 
as you can check to see if it exists, but you can't do it in the general 
case).

So it's possible to implement what is in the spec for physical files 
*or* for exact servlet mappings (where you consider that if a servlet is 
mapped to an exact URL without wildcards, and that you match that URL 
with a welcome file, you can assume it's a good idea to redirect). 
However, it's not possible for non physical resources (which is a new 
requirement).

Remy


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