remm 2003/06/24 15:37:33 Modified: catalina/src/share/org/apache/catalina/core LocalStrings.properties StandardHostDeployer.java Log: - Update processing so that unpackWARs is respected even when deploying a context file. In that case, the docBase is adjusted to reflect the unpacked WAR. Also, using the unpacked docBase in the config file is valid, and will produce the same result as pointing to the WAR file. - This fixes bug 4829. - If a context file is added for an existing context, or if a context file is updated, the context will be redeployed (note: a special workaround of some sort will likely be needed when the admin webapp commits changes, unless we accept this as an acceptable side effect). - This lacks testing, but is the final piece of the deployer refactoring (sorry for breaking stuff ...). Revision Changes Path 1.7 +1 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/LocalStrings.properties Index: LocalStrings.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- LocalStrings.properties 19 May 2003 21:54:08 -0000 1.6 +++ LocalStrings.properties 24 Jun 2003 22:37:33 -0000 1.7 @@ -98,6 +98,7 @@ standardHost.installBase=Only web applications in the Host web application directory can be installed standardHost.installing=Installing web application at context path {0} from URL {1} standardHost.installingWAR=Installing web application from URL {0} +standardHost.installingXML=Installing web application from Config file URL {0} standardHost.installError=Error deploying application at context path {0} standardHost.invalidErrorReportValveClass=Couldn't load specified error report valve class: {0} standardHost.docBase=Document base directory {0} already exists 1.13 +20 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java Index: StandardHostDeployer.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- StandardHostDeployer.java 23 Jun 2003 20:33:27 -0000 1.12 +++ StandardHostDeployer.java 24 Jun 2003 22:37:33 -0000 1.13 @@ -160,6 +160,15 @@ /** + * The config file which should replace the value set for the config file + * of the <code>Context</code>being added in the <code>addChild()</code> + * method, or <code>null</code> if the original value should remain + * untouched. + */ + private String overrideConfigFile = null; + + + /** * The string manager for this package. */ protected static StringManager sm = @@ -461,6 +470,8 @@ throw new IllegalArgumentException (sm.getString("standardHost.configNotAllowed")); + log.info(sm.getString("standardHost.installingXML", config)); + // Calculate the document base for the new web application (if needed) String docBase = null; // Optional override for value in config file boolean isWAR = false; @@ -489,6 +500,10 @@ // Install the new web application this.overrideDocBase = docBase; + if (config.toString().startsWith("file:")) { + this.overrideConfigFile = config.getFile(); + } + InputStream stream = null; try { stream = config.openStream(); @@ -512,6 +527,8 @@ ; } } + this.overrideDocBase = null; + this.overrideConfigFile = null; } } @@ -812,6 +829,8 @@ (sm.getString("standardHost.pathUsed", contextPath)); if (this.overrideDocBase != null) context.setDocBase(this.overrideDocBase); + if (this.overrideConfigFile != null) + context.setConfigFile(this.overrideConfigFile); host.fireContainerEvent(PRE_INSTALL_EVENT, context); host.addChild(child); host.fireContainerEvent(INSTALL_EVENT, context);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]