Parallel deployment
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Oct 2010 13:11:55 +0000 (13:11 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 31 Oct 2010 13:11:55 +0000 (13:11 +0000)
Start to separate context.name and context.path
Currently name==path but eventually name may include a version element but path will not.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1029330 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/StandardContext.java

index b1c2a79..d08fb78 100644 (file)
@@ -325,6 +325,12 @@ public class StandardContext extends ContainerBase
     
 
     /**
+     * Unencoded path for this web application.
+     */
+    private String path = null;
+
+
+    /**
      * The "follow standard delegation model" flag that will be used to
      * configure our ClassLoader.
      */
@@ -924,13 +930,6 @@ public class StandardContext extends ContainerBase
     }
 
 
-    @Override
-    public void setName( String name ) {
-        super.setName( name );
-        encodedPath = urlEncoder.encode(name);
-    }
-
-
     /**
      * Is caching allowed ?
      */
@@ -1870,25 +1869,22 @@ public class StandardContext extends ContainerBase
      */
     @Override
     public String getPath() {
-
-        return (getName());
-
+        return (path);
     }
 
     
     /**
      * Set the context path for this Context.
-     * <p>
-     * <b>IMPLEMENTATION NOTE</b>:  The context path is used as the "name" of
-     * a Context, because it must be unique.
-     *
+     * 
      * @param path The new context path
      */
     @Override
     public void setPath(String path) {
-
-        setName(path);
-
+        this.path = path;
+        encodedPath = urlEncoder.encode(path);
+        if (getName() == null) {
+            setName(path);
+        }
     }