From: markt Date: Thu, 21 May 2009 21:30:23 +0000 (+0000) Subject: Make a few methods static so they can easily be used from other classes (like Lifecyc... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4db39b7a2ee9e8dfe868ab52d43840b1b39c6965;p=tomcat7.0 Make a few methods static so they can easily be used from other classes (like LifecycleListeners) Add a note about manual context configuration and reload. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@777268 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java index ff0bc0f89..c42b4a0d6 100644 --- a/java/org/apache/catalina/startup/Tomcat.java +++ b/java/org/apache/catalina/startup/Tomcat.java @@ -178,6 +178,10 @@ public class Tomcat { * ctx.addErrorPage(ep); * * ctx.addMimeMapping("ext", "type"); + * + * Note: If you reload the Context, all your configuration will be lost. If + * you need reload support, consider using a LifecycleListener to provide + * your configuration. * * TODO: add the rest * @@ -212,7 +216,7 @@ public class Tomcat { * * wrapper.addInitParameter("name", "value"); */ - public StandardWrapper addServlet(StandardContext ctx, + public static StandardWrapper addServlet(StandardContext ctx, String servletName, String servletClass) { // will do class for name and set init params @@ -227,7 +231,7 @@ public class Tomcat { /** Use an existing servlet, no class.forName or initialization will be * performed */ - public StandardWrapper addServlet(StandardContext ctx, + public static StandardWrapper addServlet(StandardContext ctx, String servletName, Servlet servlet) { // will do class for name and set init params @@ -525,7 +529,7 @@ public class Tomcat { * TODO: in normal tomcat, if default-web.xml is not found, use this * method */ - protected void initWebappDefaults(StandardContext ctx) { + public static void initWebappDefaults(StandardContext ctx) { // Default servlet StandardWrapper servlet = addServlet(ctx, "default",