DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38889>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38889





------- Additional Comments From [EMAIL PROTECTED]  2006-03-08 16:47 -------
I see what mod_jk is doing in attempting to match the longest uri
pattern first.  The Servlet specification 2.4 (section SRV.11.1) says

   The container will recursively try tomatch the longest
   path-prefix. This is done by stepping down the path tree a
   directory at a time, using the / character as a path
   separator. The longest match determines the servlet selected.

This definitely favors a longest match.  However, I think it also
implies that 'longest' means 'most uri path elements'.  I'd like to
submit a patch that brings mod_jk closer to this behavior.

I'll attach the patch to this issue.  Below are some JkLogFile
examples to demonstrate what the patch does.

                                * * *


For what follows, I've set up an apache configuration with this list
of workers defined:


  JkMount /*.jsp                  worker_default
  JkMount /a/*                    worker_a
  JkMount /a/1/*                  worker_a1
  JkMount /a/1/2/*                worker_a12
  JkMount /golly-gee-batman/*     worker_golly


This is the order in which the JkMount directives appear in the httpd
configuration -- the goal is to verify that `most path elements' gets
preference.  The first two samples of log output show a stock mod_jk
1.2.15; subsequent examples show a patched mod_jk 1.2.15.


                                * * *

# (unpatched mod_jk-1.2.15)
#
# Here, we submit a non-matching URI, just to see the iteration
# order that mod_jk will use when attempting to locate a worker for
# the request.

[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (449): 
Attempting to map URI '/not-found' from 5 maps
[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/*.jsp'
[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 10:49:22 2006] [18652:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/a/*'


# (unpatched mod_jk-1.2.15)
#
# Here, we have a request for /a/1/foo.jsp.  Log entries below show
# thie request being mapped to '/*.jsp', not '/a/1/*'
#
[Wed Mar 08 10:52:56 2006] [18653:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (449): 
Attempting to map URI '/a/1/foo.jsp' from 5 maps
[Wed Mar 08 10:52:56 2006] [18653:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 10:52:56 2006] [18653:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 10:52:56 2006] [18653:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (461): 
Attempting to map context URI '/*.jsp'
[Wed Mar 08 10:52:56 2006] [18653:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (475): 
Found a wildchar match worker_default -> /*.jsp


                                * * *


# (patched mod_jk-1.2.15)
#
# Here is the same "/not-found" request, made against mod_jk-1.2.15,
# with the submitted patch.  Note that the matching order reflects
# the number of uri path elements in the JkMount directive.
#
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/not-found' from 5 maps
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/*'
[Wed Mar 08 11:31:15 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/*.jsp'


# (patched mod_jk-1.2.15)
#
#  Request for '/a/1/2/foo.jsp'
#
[Wed Mar 08 11:32:29 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/a/1/2/foo.jsp' from 5 maps
[Wed Mar 08 11:32:29 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:32:29 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (513): 
Found a wildchar match worker_a12 -> /a/1/2/*


# (patched mod_jk-1.2.15)
#
# Request for '/a/1/foo.jsp'
#
#
[Wed Mar 08 11:33:20 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/a/1/foo.jsp' from 5 maps
[Wed Mar 08 11:33:20 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:33:20 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 11:33:20 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (513): 
Found a wildchar match worker_a1 -> /a/1/*



# (patched mod_jk-1.2.15)
#
# Request for '/a/foo.jsp'
#
#
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/a/foo.jsp' from 5 maps
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/*'
[Wed Mar 08 11:34:01 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (513): 
Found a wildchar match worker_a -> /a/*


# (patched mod_jk-1.2.15)
#
# Request for '/golly-gee-batman/foo.jsp'
#
#
[Wed Mar 08 11:34:53 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/golly-gee-batman/foo.jsp' from 5 maps
[Wed Mar 08 11:34:53 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:34:53 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 11:34:53 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 11:34:53 2006] [20808:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (513): 
Found a wildchar match worker_golly -> /golly-gee-batman/*


# (patched mod_jk-1.2.15)
#
# Request for '/foo.jsp'
#
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (487): 
Attempting to map URI '/foo.jsp' from 5 maps
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/2/*'
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/1/*'
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/golly-gee-batman/*'
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/a/*'
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (499): 
Attempting to map context URI '/*.jsp'
[Wed Mar 08 11:35:27 2006] [20809:0000] [debug] 
map_uri_to_worker::jk_uri_worker_map.c (513): 
Found a wildchar match worker_default -> /*.jsp




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to