tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Date Mon, 22 Jul 2002 04:19:26 GMT
Quoting costinm@covalent.net:

> You don't need to ask tomcat - jk should have all the mappings, and
> it can already map any URI. All it has to do is:
> - for each index: 
>     -- concatenate with the current uri
>     -- do the jk mapping ( or internal redirect if you use <Location> 
> instead of the internal mapper ). If a match is found - forward to 
> tomcat.
>     -- check if a file exists. If yes - serve it as static ( since
> we already checked all servlet mappings ). 
> - if no match is found, use mod_dir to display the directory.

Just reading the algorithm and thinking about the implementation of it. Some of
the things might present themselves as big problems here in relation to servlet
mappings...

An example configuration:

<DirectoryIndex index.jsp index.vm>

The order of events would be:

1. mod_dir does a sub request for index.jsp
2. jk_map_to_storage() receives the request
3. jk_map_to_storage() engages map_uri_to_worker() <-- this would be new code
4. map_uri_to_worker() finds nothing because it has no mapping to anything that
matches *.jsp

Now, the next step is rather tricky and is the key to the whole thing. Does
jk_map_to_storage():

a) assume that there is index.jsp in one of the mappings that match the URI
minus the filename; jk_map_to_storage() could be very wrong about this - maybe
there is a default file there, but not index.jsp - this would then result in a
failed request
b) continue processing with the next index file (in this case index.vm) and
possibly miss both index.jsp and index.vm in one of the servlet mappings

Keep in mind that these are sub-requests that don't actually result in the file
being served. It's just mod_dir's  way of checking what would happen if there
was a file like that 'in the file system'. So, one cannot 'go back' and do all
this again, unless mod_dir is changed to do this kind of thing twice (which is
definitely a bad idea).

I actually think that it is not possible to establish if there is such a file,
unless mod_jk somehow knows about their exisitence. I'm not all that familir
with mappings, but I reckon that isn't the case.

And then, when everybody thought all was lost... ;-)

If my old kludge is applied (with the correct test this time) to jk_handler(),
things might be better. The kludge involved jk_handler() responding not just to
JK_HANDLER requests but also to DIR_MAGIC_TYPE requests. Now, jk_handler() would
find the mapping (since the request is for a directory, not a file) and the
request would be served by Tomcat.

Would this work? I think it might...

Bojan

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