geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1182892 - /geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Date Thu, 13 Oct 2011 14:57:21 GMT
Author: xuhaihong
Date: Thu Oct 13 14:57:21 2011
New Revision: 1182892

URL: http://svn.apache.org/viewvc?rev=1182892&view=rev
Log:
GERONIMO-6171 
a. Comment out the codes for adding default context. 
b. Use "" for the root context path
I do not think that we need to add a default context here, and actually, what is adding is
a context of "TomcatWebContainer" as context path, which looks to me make no sense. 
Also, in Tomcat, it uses "" to represent the default context, also named root context. Use
'/' as the context path, which could cause an invalid requestURI in ApplicationContext, it
could be something like //requestPath, sometimes, this will cause some issues in client applications.

Modified:
    geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java

Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=1182892&r1=1182891&r2=1182892&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Thu Oct 13 14:57:21 2011
@@ -210,7 +210,7 @@ public class TomcatContainer implements 
         embedded.setUseNaming(false);
 
         //Add default contexts
-        File rootContext = new File(System.getProperty("catalina.home") + "/ROOT");
+        /*File rootContext = new File(System.getProperty("catalina.home") + "/ROOT");
 
         String docBase = "";
         if (rootContext.exists()) {
@@ -236,7 +236,7 @@ public class TomcatContainer implements 
                 ctx.setServer(objName == null ? "geronimo" : objName.getKeyProperty(NameFactory.J2EE_SERVER));
             }
             hosts[i].addChild(defaultContext);
-        }
+        }*/
 
         // 6. Call addEngine() to attach this Engine to the set of defined
         // Engines for this object.
@@ -273,7 +273,8 @@ public class TomcatContainer implements 
      * @see org.apache.catalina.Host
      */
     public void addContext(TomcatContext ctx) throws Exception {
-        Context anotherCtxObj = embedded.createContext(ctx.getContextPath(), ctx.getDocBase(),
ctx.getClassLoader());
+        //Tomcat internally use empty string to represent the root context        
+        Context anotherCtxObj = embedded.createContext(ctx.getContextPath().equals("/") ?
"" : ctx.getContextPath(), ctx.getDocBase(), ctx.getClassLoader());
 
         // Set the context for the Tomcat implementation
         ctx.setContext(anotherCtxObj);



Mime
View raw message