You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/03/19 15:17:33 UTC

svn commit: r1667764 - /tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java

Author: markt
Date: Thu Mar 19 14:17:32 2015
New Revision: 1667764

URL: http://svn.apache.org/r1667764
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=57723
Clean-up.
Use clearer parameter names that are consistent with the docs.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java

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=1667764&r1=1667763&r2=1667764&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Thu Mar 19 14:17:32 2015
@@ -202,10 +202,8 @@ public class Tomcat {
      *
      * @throws ServletException
      */
-    public Context addWebapp(String contextPath, String baseDir)
-            throws ServletException {
-
-        return addWebapp(getHost(), contextPath, baseDir);
+    public Context addWebapp(String contextPath, String docBase) throws ServletException {
+        return addWebapp(getHost(), contextPath, docBase);
     }
 
 
@@ -241,12 +239,11 @@ public class Tomcat {
      * TODO: add the rest
      *
      *  @param contextPath "" for root context.
-     *  @param baseDir base dir for the context, for static files. Must exist,
+     *  @param docBase base dir for the context, for static files. Must exist,
      *  relative to the server home
      */
-    public Context addContext(String contextPath,
-                                      String baseDir) {
-        return addContext(getHost(), contextPath, baseDir);
+    public Context addContext(String contextPath, String docBase) {
+        return addContext(getHost(), contextPath, docBase);
     }
 
     /**
@@ -522,22 +519,26 @@ public class Tomcat {
     /**
      * @see #addWebapp(String, String)
      */
-    public Context addWebapp(Host host, String url, String path) {
-        return addWebapp(host, url, url, path);
+    public Context addWebapp(Host host, String contextPath, String docBase) {
+        return addWebapp(host, contextPath, contextPath, docBase);
     }
 
     /**
      * @see #addWebapp(String, String)
+     *
+     * @param name Ignored. The path will be used
+     *
+     * @deprecated Use {@link #addWebapp(Host, String, String)}
      */
-    public Context addWebapp(Host host, String url, String name, String path) {
-        silence(host, url);
+    @Deprecated
+    public Context addWebapp(Host host, String contextPath, String name, String docBase) {
+        silence(host, contextPath);
 
-        Context ctx = createContext(host, url);
-        ctx.setName(name);
-        ctx.setPath(url);
-        ctx.setDocBase(path);
+        Context ctx = createContext(host, contextPath);
+        ctx.setPath(contextPath);
+        ctx.setDocBase(docBase);
         ctx.addLifecycleListener(new DefaultWebXmlListener());
-        ctx.setConfigFile(getWebappConfigFile(path, url));
+        ctx.setConfigFile(getWebappConfigFile(docBase, contextPath));
 
         ContextConfig ctxCfg = new ContextConfig();
         ctx.addLifecycleListener(ctxCfg);



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