Make a few methods static so they can easily be used from other classes (like Lifecyc...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 21 May 2009 21:30:23 +0000 (21:30 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 21 May 2009 21:30:23 +0000 (21:30 +0000)
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

java/org/apache/catalina/startup/Tomcat.java

index ff0bc0f..c42b4a0 100644 (file)
@@ -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",