You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dw...@apache.org on 2008/03/18 17:47:45 UTC

svn commit: r638438 - /geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Author: dwoods
Date: Tue Mar 18 09:47:35 2008
New Revision: 638438

URL: http://svn.apache.org/viewvc?rev=638438&view=rev
Log:
GERONIMO-3921 getContextRoot() returns forward slash rather than empty string for apps deployed to root context

Modified:
    geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=638438&r1=638437&r2=638438&view=diff
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/branches/2.0/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Tue Mar 18 09:47:35 2008
@@ -228,9 +228,13 @@
             contextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
         }
         contextRoot = contextRoot.trim();
-        if (!contextRoot.startsWith("/")) {
-            //I'm not sure if we should always fix up peculiar context roots.
-            contextRoot = "/" + contextRoot;
+        if (contextRoot.length() > 0) {
+            // only force the context root to start with a forward slash
+            // if it is not null
+            if (!contextRoot.startsWith("/")) {
+                //I'm not sure if we should always fix up peculiar context roots.
+                contextRoot = "/" + contextRoot;
+            }
         }
         return contextRoot;
     }