Fix reload problem that only affected ROOT.xml. Ported from 5.5.x
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 16 Jul 2007 02:01:01 +0000 (02:01 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 16 Jul 2007 02:01:01 +0000 (02:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@556489 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ContextConfig.java
webapps/docs/changelog.xml

index 1b54546..7ea2b29 100644 (file)
@@ -881,12 +881,12 @@ public class ContextConfig
         file = new File(docBase);
         String origDocBase = docBase;
         
+        String contextPath = context.getPath();
+        if (contextPath.equals("")) {
+            contextPath = "ROOT";
+        }
         if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) {
             URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/");
-            String contextPath = context.getPath();
-            if (contextPath.equals("")) {
-                contextPath = "ROOT";
-            }
             docBase = ExpandWar.expand(host, war, contextPath);
             file = new File(docBase);
             docBase = file.getCanonicalPath();
@@ -900,7 +900,7 @@ public class ContextConfig
                 if (warFile.exists()) {
                     if (unpackWARs) {
                         URL war = new URL("jar:" + warFile.toURL() + "!/");
-                        docBase = ExpandWar.expand(host, war, context.getPath());
+                        docBase = ExpandWar.expand(host, war, contextPath);
                         file = new File(docBase);
                         docBase = file.getCanonicalPath();
                     } else {
index 51e159a..ad4fab5 100644 (file)
   <subsection name="Catalina">
     <changelog>
       <fix>
+        Handle special case of ROOT when re-loading webapp after ROOT.xml has
+        been modified. In some circumstances the reloaded ROOT webapp had no
+        associated resources. (markt)
+      </fix>
+      <fix>
         Remove invalid attribute "encoding" of MBean MemoryUserDatabase,
         which lead to errors in the manager webapp JMXProxy output. (rjung)
       </fix>