ASF Bugzilla – Attachment 21090 Details for
Bug 38131
WatchedResource does not work if app is outside "webapps"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch that fixes HostConfig to comply with the documentation regarding docBase and watched resources
38131.patch (text/plain), 3.47 KB, created by
Peter Lynch
on 2007-11-05 23:05:02 UTC
(
hide
)
Description:
patch that fixes HostConfig to comply with the documentation regarding docBase and watched resources
Filename:
MIME Type:
Creator:
Peter Lynch
Created:
2007-11-05 23:05:02 UTC
Size:
3.47 KB
patch
obsolete
>--- HostConfig.java 2007-05-04 22:43:38.000000000 -0300 >+++ HostConfig2.java 2007-11-06 02:51:43.421875000 -0400 >@@ -1,3 +1,4 @@ >+package org.apache.catalina.startup; > /* > * Licensed to the Apache Software Foundation (ASF) under one or more > * contributor license agreements. See the NOTICE file distributed with >@@ -15,23 +16,21 @@ > * limitations under the License. > */ > >- >-package org.apache.catalina.startup; >- >- > import java.io.BufferedOutputStream; > import java.io.File; > import java.io.FileOutputStream; > import java.io.IOException; > import java.io.InputStream; > import java.util.ArrayList; >+import java.util.Arrays; > import java.util.HashMap; > import java.util.LinkedHashMap; > import java.util.jar.JarEntry; > import java.util.jar.JarFile; > > import javax.management.ObjectName; >- >+import org.apache.catalina.core.StandardContext; >+import org.apache.catalina.core.StandardHost; > import org.apache.catalina.Container; > import org.apache.catalina.Context; > import org.apache.catalina.Engine; >@@ -39,8 +38,9 @@ > import org.apache.catalina.Lifecycle; > import org.apache.catalina.LifecycleEvent; > import org.apache.catalina.LifecycleListener; >+import org.apache.catalina.startup.Constants; >+import org.apache.catalina.startup.ExpandWar; > import org.apache.catalina.core.ContainerBase; >-import org.apache.catalina.core.StandardHost; > import org.apache.catalina.util.StringManager; > import org.apache.tomcat.util.digester.Digester; > import org.apache.tomcat.util.modeler.Registry; >@@ -636,11 +636,15 @@ > name = path; > } > } >- File expandedDocBase = new File(name); >- File warDocBase = new File(name + ".war"); >+ //default to appBase dir + name >+ File expandedDocBase = new File(appBase(), name); >+ if (context.getDocBase() != null) { >+ // first assume docBase is absolute >+ expandedDocBase = new File(context.getDocBase()); > if (!expandedDocBase.isAbsolute()) { >- expandedDocBase = new File(appBase(), name); >- warDocBase = new File(appBase(), name + ".war"); >+ // if docBase specified and relative, it must be relative to appBase >+ expandedDocBase = new File(appBase(), context.getDocBase()); >+ } > } > // Add the eventual unpacked WAR and all the resources which will be > // watched inside it >@@ -652,6 +656,7 @@ > addWatchedResources(deployedApp, expandedDocBase.getAbsolutePath(), context); > } else { > // Find an existing matching war and expanded folder >+ File warDocBase = new File(expandedDocBase.getAbsolutePath() + ".war"); > if (warDocBase.exists()) { > deployedApp.redeployResources.put(warDocBase.getAbsolutePath(), > new Long(warDocBase.lastModified())); >@@ -966,9 +971,11 @@ > if (docBase != null) { > resource = new File(docBaseFile, watchedResources[i]); > } else { >+ log.debug("Ignoring non-existent WatchedResource '" + resource.getAbsolutePath() + "'"); > continue; > } > } >+ log.debug("Watching WatchedResource '" + resource.getAbsolutePath() + "'"); > app.reloadResources.put(resource.getAbsolutePath(), > new Long(resource.lastModified())); > } >@@ -1329,3 +1336,4 @@ > } > > } >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38131
: 21090