James

I'm no expert on this matter (I don't use Apache), but here's my 2c.

The problem is you have two apps "competing" for mapping of URLs. We wish to
centralise it inside tomcat (in web.xml), and have the minimum amount of
config in the apache.conf as possible. Thus, we avoid the solution you are
proposing.

Check the 2.2 servlet spec to understand how mapping is done in a servlet
container.

geoff

----- Original Message -----
From: "James Courtney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 5:43 PM
Subject: RE: cvs commit: jakarta-tomcat/src/native/mod_jk/common
jk_uri_worker_map.c


> Many thanks,
> I was wondering why both the mod_jk module and IIS isapi act as filters
> instead of an Apache handler or an IIS application respectively.  In their
> current implementation they scan all request URIs for ones that they are
> responsible for and then, in the case of Apache anyway, register a call
back
> to a handler to handle the actual request.  I have had this cause problems
> for me with Apache in the case where I have a servlet named foo and
another
> file named foo.xxx.  mod_jk correctly maps /foo to the servlet and
registers
> the callback but Apache never calls the callback and instead some other
> module or the Apache core make a best guess that the request really meant
> foo.xxx since no /foo exists as far as Apache is concerned.  By adding
> handler entries to Apache's httpd.conf file like the following (pardon my
> syntax if it is somewhat off)
>
> <location path="/login">
> <handler name="jakarta-servlet">
> </location>
>
> Apache then automatically sends that URI to mod_jk without any filtering
> needed.  All mod_jk need now do is determine which Tomcat handler to use
> (ajp12, ajp13, lb, etc...).  Filtering is also more expensive because all
> modules get a chance to act on the URI before the callback handler.  By
> registering mod_jk as a handler directly, Apache maps the URI directly to
> mod_jk with basically no overhead or searching.  I've made some code
changes
> (about four changed lines) to mod_jk that make it behave as a pure handler
> with no filtering and it seems to run great but I'd like to know before
> proposing a change if there were specific reasons for the filter
> implementation.  Many thanks to anyone who can help:)
> -Jamey
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 22, 2001 7:23 PM
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-tomcat/src/native/mod_jk/common
> jk_uri_worker_map.c
>
>
> danmil      01/01/22 19:23:03
>
>   Modified:    src/native/mod_jk/common jk_uri_worker_map.c
>   Log:
>   Adding more thorough DEBUG-level to describe what mapping the module is
>   using for a given request.
>
>   Submitted by: James Courtney
>
>   Revision  Changes    Path
>   1.3       +18 -6
> jakarta-tomcat/src/native/mod_jk/common/jk_uri_worker_map.c
>
>   Index: jk_uri_worker_map.c
>   ===================================================================
>   RCS file:
> /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_uri_worker_map.c,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- jk_uri_worker_map.c 2000/11/10 18:48:50 1.2
>   +++ jk_uri_worker_map.c 2001/01/23 03:23:03 1.3
>   @@ -65,7 +65,7 @@
>     * servlet container.
> *
>     *
> *
>     * Author:      Gal Shachor <[EMAIL PROTECTED]>
> *
>   - * Version:     $Revision: 1.2 $
> *
>   + * Version:     $Revision: 1.3 $
> *
>
>
***************************************************************************/
>
>    #include "jk_pool.h"
>   @@ -358,6 +358,7 @@
>                uri = clean_uri;
>            }
>
>   + jk_log(l, JK_LOG_DEBUG, "Attempting to map URI %s\n", uri);
>            for(i = 0 ; i < uw_map->size ; i++) {
>
>                if(uw_map->maps[i].ctxt_len < longest_match) {
>   @@ -369,10 +370,20 @@
>                                uw_map->maps[i].ctxt_len)) {
>                    if(MATCH_TYPE_EXACT == uw_map->maps[i].match_type) {
>                        if(strlen(uri) == uw_map->maps[i].ctxt_len) {
>   + jk_log(l,
>   +        JK_LOG_DEBUG,
>   +        "jk_uri_worker_map_t::map_uri_to_worker, Found an exact match
> %s ->%s\n",
>   +        uw_map->maps[i].worker_name,
>   +        uw_map->maps[i].context );
>                            return uw_map->maps[i].worker_name;
>                        }
>                    } else if(MATCH_TYPE_CONTEXT ==
> uw_map->maps[i].match_type) {
>                        if(uw_map->maps[i].ctxt_len > longest_match) {
>   + jk_log(l,
>   +        JK_LOG_DEBUG,
>   +        "jk_uri_worker_map_t::map_uri_to_worker, Found a context match
> %s -> %s\n",
>   +        uw_map->maps[i].worker_name,
>   +        uw_map->maps[i].context );
>                            longest_match = uw_map->maps[i].ctxt_len;
>                            best_match = i;
>                        }
>   @@ -393,6 +404,11 @@
>                            if(0 == strcmp(suffix, uw_map->maps[i].suffix))
{
>    #endif
>                                if(uw_map->maps[i].ctxt_len >=
longest_match)
> {
>   + jk_log(l,
>   +        JK_LOG_DEBUG,
>   +        "jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match
> %s -> *.%s\n",
>   +        uw_map->maps[i].worker_name,
>   +        uw_map->maps[i].suffix );
>                                    longest_match =
uw_map->maps[i].ctxt_len;
>                                    best_match = i;
>                                }
>   @@ -403,10 +419,6 @@
>            }
>
>            if(-1 != best_match) {
>   -            jk_log(l, JK_LOG_DEBUG,
>   -                   "jk_uri_worker_map_t::map_uri_to_worker, Found a
match
> %s\n",
>   -                   uw_map->maps[best_match].worker_name);
>   -
>                return uw_map->maps[best_match].worker_name;
>            } else {
>                /*
>   @@ -435,4 +447,4 @@
>               "jk_uri_worker_map_t::map_uri_to_worker, done without a
> match\n");
>
>        return NULL;
>   -}
>   \ No newline at end of file
>   +}
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to