tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1099374 - in /tomcat/trunk: java/org/apache/catalina/startup/Tomcat.java webapps/docs/changelog.xml
Date Wed, 04 May 2011 08:48:26 GMT
Author: markt
Date: Wed May  4 08:48:26 2011
New Revision: 1099374

URL: http://svn.apache.org/viewvc?rev=1099374&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51136
Provide methods that enable the name of a Context on Context creation when using Tomcat in
an embedded scenario.
Based on a patch provided by David Calavera.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=1099374&r1=1099373&r2=1099374&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Wed May  4 08:48:26 2011
@@ -459,9 +459,15 @@ public class Tomcat {
     }
 
     public Context addContext(Host host, String contextPath, String dir) {
+        return addContext(host, contextPath, contextPath, dir);
+    }
+
+    public Context addContext(Host host, String contextPath, String contextName,
+            String dir) {
         silence(contextPath);
         Context ctx = new StandardContext();
-        ctx.setPath( contextPath );
+        ctx.setName(contextName);
+        ctx.setPath(contextPath);
         ctx.setDocBase(dir);
         ctx.addLifecycleListener(new FixContextListener());
         
@@ -474,10 +480,15 @@ public class Tomcat {
     }
     
     public Context addWebapp(Host host, String url, String path) {
+        return addWebapp(host, url, url, path);
+    }
+
+    public Context addWebapp(Host host, String url, String name, String path) {
         silence(url);
 
         Context ctx = new StandardContext();
-        ctx.setPath( url );
+        ctx.setName(name);
+        ctx.setPath(url);
         ctx.setDocBase(path);
         if (defaultRealm == null) {
             initSimpleAuth();

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1099374&r1=1099373&r2=1099374&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed May  4 08:48:26 2011
@@ -94,6 +94,11 @@
         Add a container event that is fired when a session's ID is changed,
         e.g. on authentication. (markt)
       </add>
+      <add>
+        <bug>51136</bug>: Provide methods that enable the name of a Context on
+        Context creation when using Tomcat in an embedded scenario. Based on a
+        patch provided by David Calavera. (markt)
+      </add>
       <fix>
         <bug>51137</bug>: Add additional Microsoft Office MIME type mappings.
         (rjung)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message