You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by William Barker <wb...@wilshire.com> on 2001/03/02 01:35:19 UTC

[PATCH] Exporting Servlet mappings for mod_jk

It was getting to be too much work to keep my web.xml files synced with
httpd.conf, so I got ApacheConfig.java to do it for me.  The following is
for Tomcat 3.3M1:
*** ApacheConfig.java.orig      Thu Mar  1 16:40:46 2001
--- ApacheConfig.java   Thu Mar  1 16:38:26 2001
***************
*** 328,337 ****
              mod_jk.println("#");
              mod_jk.println("# The following line mounts all JSP files and
the/servlet/ uri to tomcat");
              mod_jk.println("#");
                    mod_jk.println("JkMount " + path +"/servlet/* " +
JkMount[jkConnector]);
                    mod_jk.println("JkMount " + path +"/*.jsp " +
JkMount[jkConnector]);

-
                    // Deny serving any files from WEB-INF
              mod_jk.println();
              mod_jk.println("#");
--- 328,345 ----
              mod_jk.println("#");
              mod_jk.println("# The following line mounts all JSP files and
the/servlet/ uri to tomcat");
              mod_jk.println("#");
+ /*
                    mod_jk.println("JkMount " + path +"/servlet/* " +
JkMount[jkConnector]);
                    mod_jk.println("JkMount " + path +"/*.jsp " +
JkMount[jkConnector]);
+ */
+            Enumeration ctxMaps = context.getContainerLocations();
+            while(ctxMaps.hasMoreElements()) {
+               String cxpath = (String)ctxMaps.nextElement();
+               if(!cxpath.startsWith("/"))
+                  cxpath = "/"+cxpath;
+               mod_jk.println("JkMount " + path + cxpath +" "+
JkMount[jkConnector]);
+            }

                    // Deny serving any files from WEB-INF
              mod_jk.println();
              mod_jk.println("#");