Author: kfujino Date: Mon Feb 23 02:40:58 2015 New Revision: 1661597 URL: http://svn.apache.org/r1661597 Log: -When docBase refers internal war and unpackWARs is set to false, avoid registration of the invalid redeploy resource that has been added ".war" extension in duplicate. -If WAR exists, it is not necessary to trigger a reload when adding a Directory.
Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1661597&r1=1661596&r2=1661597&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/startup/HostConfig.java Mon Feb 23 02:40:58 2015 @@ -588,7 +588,8 @@ public class HostConfig // default to appBase dir + name expandedDocBase = new File(host.getAppBaseFile(), cn.getBaseName()); - if (context.getDocBase() != null) { + if (context.getDocBase() != null + && !context.getDocBase().toLowerCase(Locale.ENGLISH).endsWith(".war")) { // first assume docBase is absolute expandedDocBase = new File(context.getDocBase()); if (!expandedDocBase.isAbsolute()) { @@ -599,10 +600,14 @@ public class HostConfig // Add the eventual unpacked WAR and all the resources which will be // watched inside it - if (isExternalWar && unpackWARs) { - deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(), - Long.valueOf(expandedDocBase.lastModified())); - addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); + if (isExternalWar) { + if (unpackWARs) { + deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(), + Long.valueOf(expandedDocBase.lastModified())); + addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); + } else { + addWatchedResources(deployedApp, null, context); + } } else { // Find an existing matching war and expanded folder if (!isExternal) { @@ -623,12 +628,6 @@ public class HostConfig addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); } else { - if (!isExternal && !unpackWARs) { - // Trigger a reload if a DIR is added - deployedApp.reloadResources.put( - expandedDocBase.getAbsolutePath(), - Long.valueOf(0)); - } addWatchedResources(deployedApp, null, context); } // Add the context XML to the list of files which should trigger a redeployment Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1661597&r1=1661596&r2=1661597&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Mon Feb 23 02:40:58 2015 @@ -51,6 +51,15 @@ <bug>49785</bug>: Enable StartTLS connections for JNDIRealm. (fschumacher) </add> + <fix> + When docBase refers internal war and unpackWARs is set to false, avoid + registration of the invalid redeploy resource that has been added ".war" + extension in duplicate. (kfujino) + </fix> + <fix> + If WAR exists, it is not necessary to trigger a reload when adding a + Directory. (kfujino) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org