Correctly track changes to context.xml files and trigger redeployment when copyXML...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 30 Mar 2011 14:33:30 +0000 (14:33 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 30 Mar 2011 14:33:30 +0000 (14:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1086969 13f79535-47bb-0310-9956-ffa450edef68

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

index 2af28d9..fd6b181 100644 (file)
@@ -777,8 +777,15 @@ public class HostConfig
         JarEntry entry = null;
         InputStream istream = null;
         BufferedOutputStream ostream = null;
-        File xml = new File
-            (configBase(), file.substring(0, file.lastIndexOf(".")) + ".xml");
+        File xml;
+        if (copyXML) {
+            xml = new File(configBase(),
+                    file.substring(0, file.lastIndexOf(".")) + ".xml");
+        } else {
+            xml = new File(appBase(),
+                    file.substring(0, file.lastIndexOf(".")) +
+                    "/META-INF/context.xml");
+        }
         boolean xmlInWar = false;
         
         if (deployXML && !xml.exists()) {
@@ -931,6 +938,10 @@ public class HostConfig
                         Long.valueOf(docBase.lastModified()));
                 addWatchedResources(deployedApp, docBase.getAbsolutePath(),
                         context);
+                if (deployXML && !copyXML && xmlInWar) {
+                    deployedApp.redeployResources.put(xml.getAbsolutePath(),
+                            Long.valueOf(xml.lastModified()));
+                }
             } else {
                 addWatchedResources(deployedApp, null, context);
             }
index 6f702d2..62d9499 100644 (file)
         Provide a configuration option that lets the close method to be used for
         a JNDI Resource to be defined by the user. (markt)
       </add>
+      <fix>
+        Correctly track changes to context.xml files and trigger redeployment
+        when copyXML is set to false. (markt) 
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">