You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2005/10/01 22:28:35 UTC

svn commit: r293026 - in /geronimo/trunk/modules: tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java

Author: djencks
Date: Sat Oct  1 13:27:56 2005
New Revision: 293026

URL: http://svn.apache.org/viewcvs?rev=293026&view=rev
Log:
GERONIMO-1036 resolve absolute location of configuration at runtime

Modified:
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=293026&r1=293025&r2=293026&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Sat Oct  1 13:27:56 2005
@@ -405,7 +405,7 @@
             Set securityRoles = collectRoleNames(webApp);
             Map rolePermissions = new HashMap();
 
-            URI baseUri = earContext.getTargetFile(URI.create(webModule.getTargetPath() + "/")).toURI();
+            URI baseUri = URI.create(webModule.getTargetPath() + "/");       
             webModuleData.setAttribute("webAppRoot", baseUri);
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=293026&r1=293025&r2=293026&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java Sat Oct  1 13:27:56 2005
@@ -75,7 +75,7 @@
     private final Realm realm;
 
     private final List valveChain;
-    
+
     private final boolean crossContext;
 
     private final Map componentContext;
@@ -108,7 +108,7 @@
             ClassLoader classLoader,
             String objectName,
             String originalSpecDD,
-            URI webAppRoot,
+            URI relativeWebAppRoot,
             URI[] webClassPath,
             boolean contextPriorityClassLoader,
             URL configurationBaseUrl,
@@ -132,7 +132,7 @@
             throws Exception {
 
         assert classLoader != null;
-        assert webAppRoot != null;
+        assert relativeWebAppRoot != null;
         assert webClassPath != null;
         assert configurationBaseUrl != null;
         assert transactionContextManager != null;
@@ -142,7 +142,14 @@
 
 
         this.objectName = objectName;
-        this.webAppRoot = webAppRoot;
+        URI root = null;
+        //TODO is there a simpler way to do this?
+        if (configurationBaseUrl.getProtocol().equalsIgnoreCase("file")) {
+            root = new URI("file", configurationBaseUrl.getPath(), null);
+        } else {
+            root = URI.create(configurationBaseUrl.toString());
+        }
+        this.webAppRoot = root.resolve(relativeWebAppRoot);
         this.container = container;
         this.originalSpecDD = originalSpecDD;
 
@@ -181,17 +188,11 @@
         } else {
             valveChain = null;
         }
-        
+
         this.crossContext = crossContext;
 
         this.webServices = webServices;
 
-        URI root = URI.create(configurationBaseUrl.toString());
-        if (configurationBaseUrl.getProtocol().equalsIgnoreCase("file")) {
-            root = new URI("file", configurationBaseUrl.getPath(), null);
-        } else {
-            root = URI.create(configurationBaseUrl.toString());
-        }
         URL webAppRootURL = webAppRoot.toURL();
 
         URL[] urls = new URL[webClassPath.length];
@@ -200,7 +201,7 @@
             classPathEntry = root.resolve(classPathEntry);
             urls[i] = classPathEntry.toURL();
         }
-        
+
         this.webClassLoader = new TomcatClassLoader(urls, webAppRootURL, classLoader, contextPriorityClassLoader);
 
         this.kernel = kernel;
@@ -318,10 +319,10 @@
         String[] result = null;
         if ((context != null) && (context instanceof StandardContext))
             result = ((StandardContext)context).getServlets();
-        
+
         return result;
     }
-    
+
     /**
      * ObjectName must match this pattern: <p/>
      * domain:j2eeType=WebModule,name=MyName,J2EEServer=MyServer,J2EEApplication=MyApplication