tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1187791 [2/2] - /tomcat/trunk/java/org/apache/catalina/startup/
Date Sat, 22 Oct 2011 21:11:35 GMT
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=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -56,66 +56,66 @@ import org.apache.catalina.deploy.LoginC
 import org.apache.catalina.realm.GenericPrincipal;
 import org.apache.catalina.realm.RealmBase;
 
-// TODO: lazy init for the temp dir - only when a JSP is compiled or 
-// get temp dir is called we need to create it. This will avoid the 
+// TODO: lazy init for the temp dir - only when a JSP is compiled or
+// get temp dir is called we need to create it. This will avoid the
 // need for the baseDir
 
-// TODO: allow contexts without a base dir - i.e. 
+// TODO: allow contexts without a base dir - i.e.
 // only programmatic. This would disable the default servlet.
 
 /**
  * Minimal tomcat starter for embedding/unit tests.
- * 
- * Tomcat supports multiple styles of configuration and 
+ *
+ * Tomcat supports multiple styles of configuration and
  * startup - the most common and stable is server.xml-based,
  * implemented in org.apache.catalina.startup.Bootstrap.
  *
- * This class is for use in apps that embed tomcat. 
+ * This class is for use in apps that embed tomcat.
  * Requirements:
- * 
+ *
  * - all tomcat classes and possibly servlets are in the classpath.
  * ( for example all is in one big jar, or in eclipse CP, or in any other
  * combination )
- * 
+ *
  * - we need one temporary directory for work files
- * 
- * - no config file is required. This class provides methods to 
- * use if you have a webapp with a web.xml file, but it is 
+ *
+ * - no config file is required. This class provides methods to
+ * use if you have a webapp with a web.xml file, but it is
  * optional - you can use your own servlets.
- * 
+ *
  * There are a variety of 'add' methods to configure servlets and webapps. These
  * methods, by default, create a simple in-memory security realm and apply it.
  * If you need more complex security processing, you can define a subclass of
  * this class.
- * 
+ *
  * This class provides a set of convenience methods for configuring webapp
  * contexts, all overloads of the method <pre>addWebapp</pre>. These methods
  * create a webapp context, configure it, and then add it to a {@link Host}.
  * They do not use a global default web.xml; rather, they add a lifecycle
  * listener that adds the standard DefaultServlet, JSP processing, and welcome
  * files.
- * 
+ *
  * In complex cases, you may prefer to use the ordinary Tomcat API to create
  * webapp contexts; for example, you might need to install a custom Loader
  * before the call to {@link Host#addChild(Container)}. To replicate the basic
  * behavior of the <pre>addWebapp</pre> methods, you may want to call three
- * methods of this class: {@link #getDefaultRealm()}, 
- * {@link #noDefaultWebXmlPath()}, and {@link #getDefaultWebXmlListener()}. 
- * 
+ * methods of this class: {@link #getDefaultRealm()},
+ * {@link #noDefaultWebXmlPath()}, and {@link #getDefaultWebXmlListener()}.
+ *
  * {@link #getDefaultRealm()} returns the simple security realm.
- * 
+ *
  * {@link #getDefaultWebXmlListener()} returns a {@link LifecycleListener} that
  * adds the standard DefaultServlet, JSP processing, and welcome files. If you
  * add this listener, you must prevent Tomcat from applying any standard global
  * web.xml with ...
- * 
+ *
  * {@link #noDefaultWebXmlPath()} returns a dummy pathname to configure to
- * prevent {@link ContextConfig} from trying to apply a global web.xml file. 
- * 
+ * prevent {@link ContextConfig} from trying to apply a global web.xml file.
+ *
  * This class provides a main() and few simple CLI arguments,
  * see setters for doc. It can be used for simple tests and
  * demo.
- * 
+ *
  * @see <a href="http://svn.apache.org/repos/asf/tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java">TestTomcat</a>
  * @author Costin Manolache
  */
@@ -126,22 +126,22 @@ public class Tomcat {
     protected Service service;
     protected Engine engine;
     protected Connector connector; // for more - customize the classes
-    
+
     // To make it a bit easier to config for the common case
-    // ( one host, one context ). 
+    // ( one host, one context ).
     protected Host host;
 
-    // TODO: it's easy to add support for more hosts - but is it 
+    // TODO: it's easy to add support for more hosts - but is it
     // really needed ?
 
     // TODO: allow use of in-memory connector
-    
+
     protected int port = 8080;
     protected String hostname = "localhost";
     protected String basedir;
-    
-    // Default in-memory realm, will be set by default on 
-    // created contexts. Can be replaced with setRealm() on 
+
+    // Default in-memory realm, will be set by default on
+    // created contexts. Can be replaced with setRealm() on
     // the context.
     protected Realm defaultRealm;
     private Map<String, String> userPass = new HashMap<String, String>();
@@ -149,111 +149,111 @@ public class Tomcat {
         new HashMap<String, List<String>>();
     private Map<String, Principal> userPrincipals =
         new HashMap<String, Principal>();
-    
+
     public Tomcat() {
         // NOOP
     }
-    
+
     /**
-     * Tomcat needs a directory for temp files. This should be the 
-     * first method called. 
-     * 
+     * Tomcat needs a directory for temp files. This should be the
+     * first method called.
+     *
      * By default, if this method is not called, we use:
-     *  - system properties - catalina.base, catalina.home 
+     *  - system properties - catalina.base, catalina.home
      *  - $HOME/tomcat.$PORT
      * ( /tmp doesn't seem a good choice for security ).
-     *   
      *
-     * TODO: better default ? Maybe current dir ? 
+     *
+     * TODO: better default ? Maybe current dir ?
      * TODO: disable work dir if not needed ( no jsp, etc ).
      */
     public void setBaseDir(String basedir) {
         this.basedir = basedir;
     }
 
-    /** 
-     * Set the port for the default connector. Must 
+    /**
+     * Set the port for the default connector. Must
      * be called before start().
      */
     public void setPort(int port) {
         this.port = port;
     }
-    
-    /** 
-     * The the hostname of the default host, default is 
+
+    /**
+     * The the hostname of the default host, default is
      * 'localhost'.
      */
     public void setHostname(String s) {
         hostname = s;
     }
 
-    /** 
+    /**
      * Add a webapp using normal WEB-INF/web.xml if found.
-     * 
+     *
      * @param contextPath
      * @param baseDir
      * @return new Context
-     * @throws ServletException 
+     * @throws ServletException
      */
-    public Context addWebapp(String contextPath, 
+    public Context addWebapp(String contextPath,
                                      String baseDir) throws ServletException {
-        
-        return addWebapp(getHost(), contextPath, baseDir);    
+
+        return addWebapp(getHost(), contextPath, baseDir);
     }
-    
-    
-    /** 
+
+
+    /**
      * Add a context - programmatic mode, no web.xml used.
      *
      * API calls equivalent with web.xml:
-     * 
+     *
      * context-param
      *  ctx.addParameter("name", "value");
-     *     
+     *
      *
      * error-page
      *    ErrorPage ep = new ErrorPage();
      *    ep.setErrorCode(500);
      *    ep.setLocation("/error.html");
      *    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
      *
      *  @param contextPath "" for root context.
-     *  @param baseDir base dir for the context, for static files. Must exist, 
+     *  @param baseDir base dir for the context, for static files. Must exist,
      *  relative to the server home
      */
-    public Context addContext(String contextPath, 
+    public Context addContext(String contextPath,
                                       String baseDir) {
         return addContext(getHost(), contextPath, baseDir);
     }
 
     /**
-     * Equivalent with 
+     * Equivalent with
      *  <servlet><servlet-name><servlet-class>.
-     *  
-     * In general it is better/faster to use the method that takes a 
-     * Servlet as param - this one can be used if the servlet is not 
+     *
+     * In general it is better/faster to use the method that takes a
+     * Servlet as param - this one can be used if the servlet is not
      * commonly used, and want to avoid loading all deps.
      * ( for example: jsp servlet )
-     * 
+     *
      * You can customize the returned servlet, ex:
-     * 
+     *
      *    wrapper.addInitParameter("name", "value");
-     *    
+     *
      * @param contextPath   Context to add Servlet to
      * @param servletName   Servlet name (used in mappings)
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public Wrapper addServlet(String contextPath, 
-            String servletName, 
+    public Wrapper addServlet(String contextPath,
+            String servletName,
             String servletClass) {
         Container ctx = getHost().findChild(contextPath);
         return addServlet((Context) ctx, servletName, servletClass);
@@ -266,15 +266,15 @@ public class Tomcat {
      * @param servletClass  The class to be used for the Servlet
      * @return The wrapper for the servlet
      */
-    public static Wrapper addServlet(Context ctx, 
-                                      String servletName, 
+    public static Wrapper addServlet(Context ctx,
+                                      String servletName,
                                       String servletClass) {
         // will do class for name and set init params
         Wrapper sw = ctx.createWrapper();
         sw.setServletClass(servletClass);
         sw.setName(servletName);
         ctx.addChild(sw);
-        
+
         return sw;
     }
 
@@ -286,8 +286,8 @@ public class Tomcat {
      * @param servlet       The Servlet to add
      * @return The wrapper for the servlet
      */
-    public Wrapper addServlet(String contextPath, 
-            String servletName, 
+    public Wrapper addServlet(String contextPath,
+            String servletName,
             Servlet servlet) {
         Container ctx = getHost().findChild(contextPath);
         return addServlet((Context) ctx, servletName, servlet);
@@ -301,20 +301,20 @@ public class Tomcat {
      * @return The wrapper for the servlet
      */
     public static Wrapper addServlet(Context ctx,
-                                      String servletName, 
+                                      String servletName,
                                       Servlet servlet) {
         // will do class for name and set init params
         Wrapper sw = new ExistingStandardWrapper(servlet);
         sw.setName(servletName);
         ctx.addChild(sw);
-        
+
         return sw;
     }
-    
+
 
     /**
      * Initialise the server.
-     * 
+     *
      * @throws LifecycleException
      */
     public void init() throws LifecycleException {
@@ -322,12 +322,12 @@ public class Tomcat {
         getConnector();
         server.init();
     }
-    
-    
+
+
     /**
      * Start the server.
-     * 
-     * @throws LifecycleException 
+     *
+     * @throws LifecycleException
      */
     public void start() throws LifecycleException {
         getServer();
@@ -335,10 +335,10 @@ public class Tomcat {
         server.start();
     }
 
-    /** 
+    /**
      * Stop the server.
-     * 
-     * @throws LifecycleException 
+     *
+     * @throws LifecycleException
      */
     public void stop() throws LifecycleException {
         getServer();
@@ -355,18 +355,18 @@ public class Tomcat {
         server.destroy();
         // Could null out objects here
     }
-    
-    /** 
-     * Add a user for the in-memory realm. All created apps use this 
+
+    /**
+     * Add a user for the in-memory realm. All created apps use this
      * by default, can be replaced using setRealm().
-     *  
+     *
      */
     public void addUser(String user, String pass) {
         userPass.put(user, pass);
     }
-    
+
     /**
-     * @see #addUser(String, String) 
+     * @see #addUser(String, String)
      */
     public void addRole(String user, String role) {
         List<String> roles = userRoles.get(user);
@@ -379,14 +379,14 @@ public class Tomcat {
 
     // ------- Extra customization -------
     // You can tune individual tomcat objects, using internal APIs
-    
-    /** 
-     * Get the default http connector. You can set more 
+
+    /**
+     * Get the default http connector. You can set more
      * parameters - the port is already initialized.
-     * 
+     *
      * Alternatively, you can construct a Connector and set any params,
      * then call addConnector(Connector)
-     * 
+     *
      * @return A connector object that can be customized
      */
     public Connector getConnector() {
@@ -398,20 +398,20 @@ public class Tomcat {
         // default to nio. I'm having strange problems with apr
         // XXX: jfclere weird... Don't add the AprLifecycleListener then.
         // and for the use case the speed benefit wouldn't matter.
-        
+
         connector = new Connector("HTTP/1.1");
-        // connector = new Connector("org.apache.coyote.http11.Http11Protocol"); 
+        // connector = new Connector("org.apache.coyote.http11.Http11Protocol");
         connector.setPort(port);
         service.addConnector( connector );
         return connector;
     }
-    
+
     public void setConnector(Connector connector) {
         this.connector = connector;
     }
-    
-    /** 
-     * Get the service object. Can be used to add more 
+
+    /**
+     * Get the service object. Can be used to add more
      * connectors and few other global settings.
      */
     public Service getService() {
@@ -419,17 +419,17 @@ public class Tomcat {
         return service;
     }
 
-    /** 
+    /**
      * Sets the current host - all future webapps will
-     * be added to this host. When tomcat starts, the 
+     * be added to this host. When tomcat starts, the
      * host will be the default host.
-     * 
+     *
      * @param host
      */
     public void setHost(Host host) {
         this.host = host;
     }
-    
+
     public Host getHost() {
         if (host == null) {
             host = new StandardHost();
@@ -439,19 +439,19 @@ public class Tomcat {
         }
         return host;
     }
-    
-    /** 
+
+    /**
      * Set a custom realm for auth. If not called, a simple
      * default will be used, using an internal map.
-     * 
+     *
      * Must be called before adding a context.
      */
     public void setDefaultRealm(Realm realm) {
         defaultRealm = realm;
     }
-    
 
-    /** 
+
+    /**
      * Access to the engine, for further customization.
      */
     public Engine getEngine() {
@@ -467,21 +467,21 @@ public class Tomcat {
 
     /**
      * Get the server object. You can add listeners and few more
-     * customizations. JNDI is disabled by default.  
+     * customizations. JNDI is disabled by default.
      */
     public Server getServer() {
-        
+
         if (server != null) {
             return server;
         }
-        
-        initBaseDir(); 
-        
+
+        initBaseDir();
+
         System.setProperty("catalina.useNaming", "false");
-        
+
         server = new StandardServer();
         server.setPort( -1 );
-        
+
         service = new StandardService();
         service.setName("Tomcat");
         server.addService( service );
@@ -500,7 +500,7 @@ public class Tomcat {
         ctx.setPath(contextPath);
         ctx.setDocBase(dir);
         ctx.addLifecycleListener(new FixContextListener());
-        
+
         if (host == null) {
             getHost().addChild(ctx);
         } else {
@@ -508,7 +508,7 @@ public class Tomcat {
         }
         return ctx;
     }
-    
+
     public Context addWebapp(Host host, String url, String path) {
         return addWebapp(host, url, url, path);
     }
@@ -526,10 +526,10 @@ public class Tomcat {
         ctx.setRealm(defaultRealm);
 
         ctx.addLifecycleListener(new DefaultWebXmlListener());
-        
+
         ContextConfig ctxCfg = new ContextConfig();
         ctx.addLifecycleListener(ctxCfg);
-        
+
         // prevent it from looking ( if it finds one - it'll have dup error )
         ctxCfg.setDefaultWebXml(noDefaultWebXmlPath());
 
@@ -541,19 +541,19 @@ public class Tomcat {
 
         return ctx;
     }
-    
+
     /**
      * Return a listener that provides the required configuration items for JSP
      * processing. From the standard Tomcat global web.xml. Pass this to
      * {@link Context#addLifecycleListener(LifecycleListener)} and then pass the
-     * result of {@link #noDefaultWebXmlPath()} to 
-     * {@link ContextConfig#setDefaultWebXml(String)}. 
+     * result of {@link #noDefaultWebXmlPath()} to
+     * {@link ContextConfig#setDefaultWebXml(String)}.
      * @return a listener object that configures default JSP processing.
      */
     public LifecycleListener getDefaultWebXmlListener() {
         return new DefaultWebXmlListener();
     }
-    
+
     /**
      * @return a pathname to pass to
      * {@link ContextConfig#setDefaultWebXml(String)} when using
@@ -562,7 +562,7 @@ public class Tomcat {
     public String noDefaultWebXmlPath() {
         return Constants.NoDefaultWebXml;
     }
-    
+
     /**
      * For complex configurations, this accessor allows callers of this class
      * to obtain the simple realm created by default.
@@ -577,10 +577,10 @@ public class Tomcat {
 
 
     // ---------- Helper methods and classes -------------------
-    
-    /** 
-     * Initialize an in-memory realm. You can replace it 
-     * for contexts with a real one. 
+
+    /**
+     * Initialize an in-memory realm. You can replace it
+     * for contexts with a real one.
      */
     protected void initSimpleAuth() {
         defaultRealm = new RealmBase() {
@@ -607,10 +607,10 @@ public class Tomcat {
                 }
                 return p;
             }
-            
-        };        
+
+        };
     }
-    
+
     protected void initBaseDir() {
         String catalinaHome = System.getProperty(Globals.CATALINA_HOME_PROP);
         if (basedir == null) {
@@ -621,7 +621,7 @@ public class Tomcat {
         }
         if (basedir == null) {
             // Create a temp dir.
-            basedir = System.getProperty("user.dir") + 
+            basedir = System.getProperty("user.dir") +
                 "/tomcat." + port;
             File home = new File(basedir);
             home.mkdir();
@@ -647,7 +647,7 @@ public class Tomcat {
         "org.apache.catalina.core.ApplicationContext",
         "org.apache.catalina.core.AprLifecycleListener"
     };
-    
+
     /**
      * Controls if the loggers will be silenced or not.
      * @param silent    <code>true</code> sets the log level to WARN for the
@@ -665,28 +665,28 @@ public class Tomcat {
             }
         }
     }
-    
+
     private void silence(String ctx) {
         String base = "org.apache.catalina.core.ContainerBase.[default].[";
         base += getHost().getName();
         base += "].[";
-        base += ctx; 
+        base += ctx;
         base += "]";
         Logger.getLogger(base).setLevel(Level.WARNING);
     }
-    
+
     /**
      * Enables JNDI naming which is disabled by default. Server must implement
      * {@link Lifecycle} in order for the {@link NamingContextListener} to be
      * used.
-     * 
+     *
      */
     public void enableNaming() {
         // Make sure getServer() has been called as that is where naming is
         // disabled
         getServer();
         server.addLifecycleListener(new NamingContextListener());
-        
+
         System.setProperty("catalina.useNaming", "true");
 
         String value = "org.apache.naming";
@@ -712,24 +712,24 @@ public class Tomcat {
 
     /**
      * Provide default configuration for a context. This is the programmatic
-     * equivalent of the default web.xml. 
-     * 
-     *  TODO: in normal Tomcat, if default-web.xml is not found, use this 
+     * equivalent of the default web.xml.
+     *
+     *  TODO: in normal Tomcat, if default-web.xml is not found, use this
      *  method
-     *  
+     *
      * @param contextPath   The context to set the defaults for
      */
     public void initWebappDefaults(String contextPath) {
         Container ctx = getHost().findChild(contextPath);
         initWebappDefaults((Context) ctx);
     }
-    
+
     /**
      * Static version of {@link #initWebappDefaults(String)}
      * @param ctx   The context to set the defaults for
      */
     public static void initWebappDefaults(Context ctx) {
-        // Default servlet 
+        // Default servlet
         Wrapper servlet = addServlet(
                 ctx, "default", "org.apache.catalina.servlets.DefaultServlet");
         servlet.setLoadOnStartup(1);
@@ -739,31 +739,31 @@ public class Tomcat {
                 ctx, "jsp", "org.apache.jasper.servlet.JspServlet");
         servlet.addInitParameter("fork", "false");
         servlet.setLoadOnStartup(3);
-        
-        // Servlet mappings 
+
+        // Servlet mappings
         ctx.addServletMapping("/", "default");
         ctx.addServletMapping("*.jsp", "jsp");
         ctx.addServletMapping("*.jspx", "jsp");
 
         // Sessions
         ctx.setSessionTimeout(30);
-        
+
         // MIME mappings
         for (int i = 0; i < DEFAULT_MIME_MAPPINGS.length;) {
             ctx.addMimeMapping(DEFAULT_MIME_MAPPINGS[i++],
                     DEFAULT_MIME_MAPPINGS[i++]);
         }
-        
+
         // Welcome files
         ctx.addWelcomeFile("index.html");
         ctx.addWelcomeFile("index.htm");
         ctx.addWelcomeFile("index.jsp");
     }
 
-    
+
     /**
      * Fix startup sequence - required if you don't use web.xml.
-     * 
+     *
      * The start() method in context will set 'configured' to false - and
      * expects a listener to set it back to true.
      */
@@ -787,7 +787,7 @@ public class Tomcat {
                 return;
             }
         }
-        
+
     }
 
 
@@ -807,9 +807,9 @@ public class Tomcat {
 
 
     /**
-     * Helper class for wrapping existing servlets. This disables servlet 
+     * Helper class for wrapping existing servlets. This disables servlet
      * lifecycle and normal reloading, but also reduces overhead and provide
-     * more direct control over the servlet.  
+     * more direct control over the servlet.
      */
     public static class ExistingStandardWrapper extends StandardWrapper {
         private Servlet existing;
@@ -850,7 +850,7 @@ public class Tomcat {
         }
         @Override
         public boolean isUnavailable() {
-            return false;       
+            return false;
         }
         @Override
         public Servlet getServlet() {
@@ -861,102 +861,102 @@ public class Tomcat {
             return existing.getClass().getName();
         }
     }
-    
+
     /**
      * TODO: would a properties resource be better ? Or just parsing
      * /etc/mime.types ?
-     * This is needed because we don't use the default web.xml, where this 
+     * This is needed because we don't use the default web.xml, where this
      * is encoded.
      */
     private static final String[] DEFAULT_MIME_MAPPINGS = {
-        "abs", "audio/x-mpeg", 
-        "ai", "application/postscript", 
-        "aif", "audio/x-aiff", 
-        "aifc", "audio/x-aiff", 
-        "aiff", "audio/x-aiff", 
-        "aim", "application/x-aim", 
-        "art", "image/x-jg", 
-        "asf", "video/x-ms-asf", 
-        "asx", "video/x-ms-asf", 
-        "au", "audio/basic", 
-        "avi", "video/x-msvideo", 
-        "avx", "video/x-rad-screenplay", 
-        "bcpio", "application/x-bcpio", 
-        "bin", "application/octet-stream", 
-        "bmp", "image/bmp", 
-        "body", "text/html", 
-        "cdf", "application/x-cdf", 
-        "cer", "application/x-x509-ca-cert", 
-        "class", "application/java", 
-        "cpio", "application/x-cpio", 
-        "csh", "application/x-csh", 
-        "css", "text/css", 
-        "dib", "image/bmp", 
-        "doc", "application/msword", 
-        "dtd", "application/xml-dtd", 
-        "dv", "video/x-dv", 
-        "dvi", "application/x-dvi", 
-        "eps", "application/postscript", 
-        "etx", "text/x-setext", 
-        "exe", "application/octet-stream", 
-        "gif", "image/gif", 
-        "gtar", "application/x-gtar", 
-        "gz", "application/x-gzip", 
-        "hdf", "application/x-hdf", 
-        "hqx", "application/mac-binhex40", 
-        "htc", "text/x-component", 
-        "htm", "text/html", 
-        "html", "text/html", 
-        "hqx", "application/mac-binhex40", 
-        "ief", "image/ief", 
-        "jad", "text/vnd.sun.j2me.app-descriptor", 
-        "jar", "application/java-archive", 
-        "java", "text/plain", 
-        "jnlp", "application/x-java-jnlp-file", 
-        "jpe", "image/jpeg", 
-        "jpeg", "image/jpeg", 
-        "jpg", "image/jpeg", 
-        "js", "text/javascript", 
-        "jsf", "text/plain", 
-        "jspf", "text/plain", 
-        "kar", "audio/x-midi", 
-        "latex", "application/x-latex", 
-        "m3u", "audio/x-mpegurl", 
-        "mac", "image/x-macpaint", 
-        "man", "application/x-troff-man", 
-        "mathml", "application/mathml+xml", 
-        "me", "application/x-troff-me", 
-        "mid", "audio/x-midi", 
-        "midi", "audio/x-midi", 
-        "mif", "application/x-mif", 
-        "mov", "video/quicktime", 
-        "movie", "video/x-sgi-movie", 
-        "mp1", "audio/x-mpeg", 
-        "mp2", "audio/x-mpeg", 
-        "mp3", "audio/x-mpeg", 
-        "mp4", "video/mp4", 
-        "mpa", "audio/x-mpeg", 
-        "mpe", "video/mpeg", 
-        "mpeg", "video/mpeg", 
-        "mpega", "audio/x-mpeg", 
-        "mpg", "video/mpeg", 
-        "mpv2", "video/mpeg2", 
-        "ms", "application/x-wais-source", 
-        "nc", "application/x-netcdf", 
-        "oda", "application/oda", 
-        "odb", "application/vnd.oasis.opendocument.database", 
-        "odc", "application/vnd.oasis.opendocument.chart", 
-        "odf", "application/vnd.oasis.opendocument.formula", 
-        "odg", "application/vnd.oasis.opendocument.graphics", 
-        "odi", "application/vnd.oasis.opendocument.image", 
-        "odm", "application/vnd.oasis.opendocument.text-master", 
-        "odp", "application/vnd.oasis.opendocument.presentation", 
-        "ods", "application/vnd.oasis.opendocument.spreadsheet", 
-        "odt", "application/vnd.oasis.opendocument.text", 
-        "otg", "application/vnd.oasis.opendocument.graphics-template", 
-        "oth", "application/vnd.oasis.opendocument.text-web", 
-        "otp", "application/vnd.oasis.opendocument.presentation-template", 
-        "ots", "application/vnd.oasis.opendocument.spreadsheet-template ", 
+        "abs", "audio/x-mpeg",
+        "ai", "application/postscript",
+        "aif", "audio/x-aiff",
+        "aifc", "audio/x-aiff",
+        "aiff", "audio/x-aiff",
+        "aim", "application/x-aim",
+        "art", "image/x-jg",
+        "asf", "video/x-ms-asf",
+        "asx", "video/x-ms-asf",
+        "au", "audio/basic",
+        "avi", "video/x-msvideo",
+        "avx", "video/x-rad-screenplay",
+        "bcpio", "application/x-bcpio",
+        "bin", "application/octet-stream",
+        "bmp", "image/bmp",
+        "body", "text/html",
+        "cdf", "application/x-cdf",
+        "cer", "application/x-x509-ca-cert",
+        "class", "application/java",
+        "cpio", "application/x-cpio",
+        "csh", "application/x-csh",
+        "css", "text/css",
+        "dib", "image/bmp",
+        "doc", "application/msword",
+        "dtd", "application/xml-dtd",
+        "dv", "video/x-dv",
+        "dvi", "application/x-dvi",
+        "eps", "application/postscript",
+        "etx", "text/x-setext",
+        "exe", "application/octet-stream",
+        "gif", "image/gif",
+        "gtar", "application/x-gtar",
+        "gz", "application/x-gzip",
+        "hdf", "application/x-hdf",
+        "hqx", "application/mac-binhex40",
+        "htc", "text/x-component",
+        "htm", "text/html",
+        "html", "text/html",
+        "hqx", "application/mac-binhex40",
+        "ief", "image/ief",
+        "jad", "text/vnd.sun.j2me.app-descriptor",
+        "jar", "application/java-archive",
+        "java", "text/plain",
+        "jnlp", "application/x-java-jnlp-file",
+        "jpe", "image/jpeg",
+        "jpeg", "image/jpeg",
+        "jpg", "image/jpeg",
+        "js", "text/javascript",
+        "jsf", "text/plain",
+        "jspf", "text/plain",
+        "kar", "audio/x-midi",
+        "latex", "application/x-latex",
+        "m3u", "audio/x-mpegurl",
+        "mac", "image/x-macpaint",
+        "man", "application/x-troff-man",
+        "mathml", "application/mathml+xml",
+        "me", "application/x-troff-me",
+        "mid", "audio/x-midi",
+        "midi", "audio/x-midi",
+        "mif", "application/x-mif",
+        "mov", "video/quicktime",
+        "movie", "video/x-sgi-movie",
+        "mp1", "audio/x-mpeg",
+        "mp2", "audio/x-mpeg",
+        "mp3", "audio/x-mpeg",
+        "mp4", "video/mp4",
+        "mpa", "audio/x-mpeg",
+        "mpe", "video/mpeg",
+        "mpeg", "video/mpeg",
+        "mpega", "audio/x-mpeg",
+        "mpg", "video/mpeg",
+        "mpv2", "video/mpeg2",
+        "ms", "application/x-wais-source",
+        "nc", "application/x-netcdf",
+        "oda", "application/oda",
+        "odb", "application/vnd.oasis.opendocument.database",
+        "odc", "application/vnd.oasis.opendocument.chart",
+        "odf", "application/vnd.oasis.opendocument.formula",
+        "odg", "application/vnd.oasis.opendocument.graphics",
+        "odi", "application/vnd.oasis.opendocument.image",
+        "odm", "application/vnd.oasis.opendocument.text-master",
+        "odp", "application/vnd.oasis.opendocument.presentation",
+        "ods", "application/vnd.oasis.opendocument.spreadsheet",
+        "odt", "application/vnd.oasis.opendocument.text",
+        "otg", "application/vnd.oasis.opendocument.graphics-template",
+        "oth", "application/vnd.oasis.opendocument.text-web",
+        "otp", "application/vnd.oasis.opendocument.presentation-template",
+        "ots", "application/vnd.oasis.opendocument.spreadsheet-template ",
         "ott", "application/vnd.oasis.opendocument.text-template",
         "ogx", "application/ogg",
         "ogv", "video/ogg",
@@ -968,79 +968,79 @@ public class Tomcat {
         "axa", "audio/annodex",
         "axv", "video/annodex",
         "xspf", "application/xspf+xml",
-        "pbm", "image/x-portable-bitmap", 
-        "pct", "image/pict", 
-        "pdf", "application/pdf", 
-        "pgm", "image/x-portable-graymap", 
-        "pic", "image/pict", 
-        "pict", "image/pict", 
-        "pls", "audio/x-scpls", 
-        "png", "image/png", 
-        "pnm", "image/x-portable-anymap", 
-        "pnt", "image/x-macpaint", 
-        "ppm", "image/x-portable-pixmap", 
+        "pbm", "image/x-portable-bitmap",
+        "pct", "image/pict",
+        "pdf", "application/pdf",
+        "pgm", "image/x-portable-graymap",
+        "pic", "image/pict",
+        "pict", "image/pict",
+        "pls", "audio/x-scpls",
+        "png", "image/png",
+        "pnm", "image/x-portable-anymap",
+        "pnt", "image/x-macpaint",
+        "ppm", "image/x-portable-pixmap",
         "ppt", "application/vnd.ms-powerpoint",
         "pps", "application/vnd.ms-powerpoint",
-        "ps", "application/postscript", 
-        "psd", "image/x-photoshop", 
-        "qt", "video/quicktime", 
-        "qti", "image/x-quicktime", 
-        "qtif", "image/x-quicktime", 
-        "ras", "image/x-cmu-raster", 
-        "rdf", "application/rdf+xml", 
-        "rgb", "image/x-rgb", 
-        "rm", "application/vnd.rn-realmedia", 
-        "roff", "application/x-troff", 
-        "rtf", "application/rtf", 
-        "rtx", "text/richtext", 
-        "sh", "application/x-sh", 
-        "shar", "application/x-shar", 
+        "ps", "application/postscript",
+        "psd", "image/x-photoshop",
+        "qt", "video/quicktime",
+        "qti", "image/x-quicktime",
+        "qtif", "image/x-quicktime",
+        "ras", "image/x-cmu-raster",
+        "rdf", "application/rdf+xml",
+        "rgb", "image/x-rgb",
+        "rm", "application/vnd.rn-realmedia",
+        "roff", "application/x-troff",
+        "rtf", "application/rtf",
+        "rtx", "text/richtext",
+        "sh", "application/x-sh",
+        "shar", "application/x-shar",
         /*"shtml", "text/x-server-parsed-html",*/
-        "smf", "audio/x-midi", 
-        "sit", "application/x-stuffit", 
-        "snd", "audio/basic", 
-        "src", "application/x-wais-source", 
-        "sv4cpio", "application/x-sv4cpio", 
-        "sv4crc", "application/x-sv4crc", 
-        "svg", "image/svg+xml", 
-        "svgz", "image/svg+xml", 
-        "swf", "application/x-shockwave-flash", 
-        "t", "application/x-troff", 
-        "tar", "application/x-tar", 
-        "tcl", "application/x-tcl", 
-        "tex", "application/x-tex", 
-        "texi", "application/x-texinfo", 
-        "texinfo", "application/x-texinfo", 
-        "tif", "image/tiff", 
-        "tiff", "image/tiff", 
-        "tr", "application/x-troff", 
-        "tsv", "text/tab-separated-values", 
-        "txt", "text/plain", 
-        "ulw", "audio/basic", 
-        "ustar", "application/x-ustar", 
-        "vxml", "application/voicexml+xml", 
-        "xbm", "image/x-xbitmap", 
-        "xht", "application/xhtml+xml", 
-        "xhtml", "application/xhtml+xml", 
-        "xls", "application/vnd.ms-excel", 
-        "xml", "application/xml", 
-        "xpm", "image/x-xpixmap", 
-        "xsl", "application/xml", 
-        "xslt", "application/xslt+xml", 
-        "xul", "application/vnd.mozilla.xul+xml", 
-        "xwd", "image/x-xwindowdump", 
-        "vsd", "application/x-visio", 
-        "wav", "audio/x-wav", 
-        "wbmp", "image/vnd.wap.wbmp", 
-        "wml", "text/vnd.wap.wml", 
-        "wmlc", "application/vnd.wap.wmlc", 
-        "wmls", "text/vnd.wap.wmlscript", 
-        "wmlscriptc", "application/vnd.wap.wmlscriptc", 
-        "wmv", "video/x-ms-wmv", 
-        "wrl", "x-world/x-vrml", 
-        "wspolicy", "application/wspolicy+xml", 
-        "Z", "application/x-compress", 
-        "z", "application/x-compress", 
-        "zip", "application/zip" 
+        "smf", "audio/x-midi",
+        "sit", "application/x-stuffit",
+        "snd", "audio/basic",
+        "src", "application/x-wais-source",
+        "sv4cpio", "application/x-sv4cpio",
+        "sv4crc", "application/x-sv4crc",
+        "svg", "image/svg+xml",
+        "svgz", "image/svg+xml",
+        "swf", "application/x-shockwave-flash",
+        "t", "application/x-troff",
+        "tar", "application/x-tar",
+        "tcl", "application/x-tcl",
+        "tex", "application/x-tex",
+        "texi", "application/x-texinfo",
+        "texinfo", "application/x-texinfo",
+        "tif", "image/tiff",
+        "tiff", "image/tiff",
+        "tr", "application/x-troff",
+        "tsv", "text/tab-separated-values",
+        "txt", "text/plain",
+        "ulw", "audio/basic",
+        "ustar", "application/x-ustar",
+        "vxml", "application/voicexml+xml",
+        "xbm", "image/x-xbitmap",
+        "xht", "application/xhtml+xml",
+        "xhtml", "application/xhtml+xml",
+        "xls", "application/vnd.ms-excel",
+        "xml", "application/xml",
+        "xpm", "image/x-xpixmap",
+        "xsl", "application/xml",
+        "xslt", "application/xslt+xml",
+        "xul", "application/vnd.mozilla.xul+xml",
+        "xwd", "image/x-xwindowdump",
+        "vsd", "application/x-visio",
+        "wav", "audio/x-wav",
+        "wbmp", "image/vnd.wap.wbmp",
+        "wml", "text/vnd.wap.wml",
+        "wmlc", "application/vnd.wap.wmlc",
+        "wmls", "text/vnd.wap.wmlscript",
+        "wmlscriptc", "application/vnd.wap.wmlscriptc",
+        "wmv", "video/x-ms-wmv",
+        "wrl", "x-world/x-vrml",
+        "wspolicy", "application/wspolicy+xml",
+        "Z", "application/x-compress",
+        "z", "application/x-compress",
+        "zip", "application/zip"
     };
 }

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tool.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tool.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -76,7 +76,7 @@ public final class Tool {
 
 
     private static final Log log = LogFactory.getLog(Tool.class);
-    
+
     // ------------------------------------------------------- Static Variables
 
 

Modified: tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/UserConfig.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,7 +48,7 @@ public final class UserConfig
     private static final org.apache.juli.logging.Log log=
         org.apache.juli.logging.LogFactory.getLog( UserConfig.class );
 
-    
+
     // ----------------------------------------------------- Instance Variables
 
 

Modified: tomcat/trunk/java/org/apache/catalina/startup/UserDatabase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/UserDatabase.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/UserDatabase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/UserDatabase.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Modified: tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -43,27 +43,27 @@ import org.apache.catalina.deploy.Messag
  */
 
 public class WebAnnotationSet {
-    
-    
+
+
     // --------------------------------------------------------- Public Methods
-    
-    
+
+
     /**
      * Process the annotations on a context.
      */
     public static void loadApplicationAnnotations(Context context) {
-        
+
         loadApplicationListenerAnnotations(context);
         loadApplicationFilterAnnotations(context);
         loadApplicationServletAnnotations(context);
-        
-        
+
+
     }
-    
-    
+
+
     // -------------------------------------------------------- protected Methods
-    
-    
+
+
     /**
      * Process the annotations for the listeners.
      */
@@ -73,8 +73,8 @@ public class WebAnnotationSet {
             loadClassAnnotation(context, applicationListeners[i]);
         }
     }
-    
-    
+
+
     /**
      * Process the annotations for the filters.
      */
@@ -84,26 +84,26 @@ public class WebAnnotationSet {
             loadClassAnnotation(context, (filterDefs[i]).getFilterClass());
         }
     }
-    
-    
+
+
     /**
      * Process the annotations for the servlets.
      */
     protected static void loadApplicationServletAnnotations(Context context) {
-        
+
         ClassLoader classLoader = context.getLoader().getClassLoader();
         StandardWrapper wrapper = null;
         Class<?> classClass = null;
-        
+
         Container[] children = context.findChildren();
         for (int i = 0; i < children.length; i++) {
             if (children[i] instanceof StandardWrapper) {
-                
+
                 wrapper = (StandardWrapper) children[i];
                 if (wrapper.getServletClass() == null) {
                     continue;
                 }
-                
+
                 try {
                     classClass = classLoader.loadClass(wrapper.getServletClass());
                 } catch (ClassNotFoundException e) {
@@ -111,11 +111,11 @@ public class WebAnnotationSet {
                 } catch (NoClassDefFoundError e) {
                     // We do nothing
                 }
-                
+
                 if (classClass == null) {
                     continue;
                 }
-                
+
                 loadClassAnnotation(context, wrapper.getServletClass());
                 /* Process RunAs annotation which can be only on servlets.
                  * Ref JSR 250, equivalent to the run-as element in
@@ -127,19 +127,19 @@ public class WebAnnotationSet {
                 }
             }
         }
-        
-        
+
+
     }
-    
-    
+
+
     /**
      * Process the annotations on a context for a given className.
      */
     protected static void loadClassAnnotation(Context context, String fileString) {
-        
+
         ClassLoader classLoader = context.getLoader().getClassLoader();
         Class<?> classClass = null;
-        
+
         try {
             classClass = classLoader.loadClass(fileString);
         } catch (ClassNotFoundException e) {
@@ -147,13 +147,13 @@ public class WebAnnotationSet {
         } catch (NoClassDefFoundError e) {
             // We do nothing
         }
-        
+
         if (classClass == null) {
             return;
         }
-        
+
         // Initialize the annotations
-        
+
         if (classClass.isAnnotationPresent(Resource.class)) {
             Resource annotation = classClass.getAnnotation(Resource.class);
             addResource(context, annotation);
@@ -171,67 +171,67 @@ public class WebAnnotationSet {
          * Ref JSR 224, equivalent to the ejb-ref or ejb-local-ref
          * element in the deployment descriptor.
         if (classClass.isAnnotationPresent(EJB.class)) {
-            EJB annotation = (EJB) 
+            EJB annotation = (EJB)
             classClass.getAnnotation(EJB.class);
-            
+
             if ((annotation.mappedName().length() == 0) ||
                     annotation.mappedName().equals("Local")) {
-                
+
                 ContextLocalEjb ejb = new ContextLocalEjb();
-                
+
                 ejb.setName(annotation.name());
                 ejb.setType(annotation.beanInterface().getCanonicalName());
                 ejb.setDescription(annotation.description());
-                
+
                 ejb.setHome(annotation.beanName());
-                
+
                 context.getNamingResources().addLocalEjb(ejb);
-                
+
             } else if (annotation.mappedName().equals("Remote")) {
-                
+
                 ContextEjb ejb = new ContextEjb();
-                
+
                 ejb.setName(annotation.name());
                 ejb.setType(annotation.beanInterface().getCanonicalName());
                 ejb.setDescription(annotation.description());
-                
+
                 ejb.setHome(annotation.beanName());
-                
+
                 context.getNamingResources().addEjb(ejb);
-                
+
             }
-            
+
         }
          */
         /* Process WebServiceRef annotation.
-         * Ref JSR 224, equivalent to the service-ref element in 
+         * Ref JSR 224, equivalent to the service-ref element in
          * the deployment descriptor.
          * The service-ref registration is not implemented
         if (classClass.isAnnotationPresent(WebServiceRef.class)) {
-            WebServiceRef annotation = (WebServiceRef) 
+            WebServiceRef annotation = (WebServiceRef)
             classClass.getAnnotation(WebServiceRef.class);
-            
+
             ContextService service = new ContextService();
-            
+
             service.setName(annotation.name());
             service.setWsdlfile(annotation.wsdlLocation());
-            
+
             service.setType(annotation.type().getCanonicalName());
-            
+
             if (annotation.value() == null)
                 service.setServiceinterface(annotation.type().getCanonicalName());
-            
+
             if (annotation.type().getCanonicalName().equals("Service"))
                 service.setServiceinterface(annotation.type().getCanonicalName());
-            
+
             if (annotation.value().getCanonicalName().equals("Endpoint"))
                 service.setServiceendpoint(annotation.type().getCanonicalName());
-            
+
             service.setPortlink(annotation.type().getCanonicalName());
-            
+
             context.getNamingResources().addService(service);
-            
-            
+
+
         }
          */
         /* Process DeclareRoles annotation.
@@ -245,11 +245,11 @@ public class WebAnnotationSet {
                 context.addSecurityRole(annotation.value()[i]);
             }
         }
-        
-        
+
+
     }
-    
-    
+
+
     /**
      * Process a Resource annotation to set up a Resource.
      * Ref JSR 250, equivalent to the resource-ref,
@@ -257,7 +257,7 @@ public class WebAnnotationSet {
      * or service-ref element in the deployment descriptor.
      */
     protected static void addResource(Context context, Resource annotation) {
-        
+
         if (annotation.type().getCanonicalName().equals("java.lang.String") ||
                 annotation.type().getCanonicalName().equals("java.lang.Character") ||
                 annotation.type().getCanonicalName().equals("java.lang.Integer") ||
@@ -267,32 +267,32 @@ public class WebAnnotationSet {
                 annotation.type().getCanonicalName().equals("java.lang.Short") ||
                 annotation.type().getCanonicalName().equals("java.lang.Long") ||
                 annotation.type().getCanonicalName().equals("java.lang.Float")) {
-            
+
             // env-ref element
             ContextEnvironment resource = new ContextEnvironment();
-            
+
             resource.setName(annotation.name());
             resource.setType(annotation.type().getCanonicalName());
-            
+
             resource.setDescription(annotation.description());
-            
+
             resource.setValue(annotation.mappedName());
-            
+
             context.getNamingResources().addEnvironment(resource);
-            
+
         } else if (annotation.type().getCanonicalName().equals("javax.xml.rpc.Service")) {
-            
+
             // service-ref element
             ContextService service = new ContextService();
-            
+
             service.setName(annotation.name());
             service.setWsdlfile(annotation.mappedName());
-            
+
             service.setType(annotation.type().getCanonicalName());
             service.setDescription(annotation.description());
-            
+
             context.getNamingResources().addService(service);
-            
+
         } else if (annotation.type().getCanonicalName().equals("javax.sql.DataSource") ||
                 annotation.type().getCanonicalName().equals("javax.jms.ConnectionFactory") ||
                 annotation.type().getCanonicalName()
@@ -305,13 +305,13 @@ public class WebAnnotationSet {
                 .equals("javax.resource.cci.ConnectionFactory") ||
                 annotation.type().getCanonicalName().equals("org.omg.CORBA_2_3.ORB") ||
                 annotation.type().getCanonicalName().endsWith("ConnectionFactory")) {
-            
+
             // resource-ref element
             ContextResource resource = new ContextResource();
-            
+
             resource.setName(annotation.name());
             resource.setType(annotation.type().getCanonicalName());
-            
+
             if (annotation.authenticationType()
                     == Resource.AuthenticationType.CONTAINER) {
                 resource.setAuth("Container");
@@ -320,48 +320,48 @@ public class WebAnnotationSet {
                     == Resource.AuthenticationType.APPLICATION) {
                 resource.setAuth("Application");
             }
-            
+
             resource.setScope(annotation.shareable() ? "Shareable" : "Unshareable");
             resource.setProperty("mappedName", annotation.mappedName());
             resource.setDescription(annotation.description());
-            
+
             context.getNamingResources().addResource(resource);
-            
+
         } else if (annotation.type().getCanonicalName().equals("javax.jms.Queue") ||
                 annotation.type().getCanonicalName().equals("javax.jms.Topic")) {
-            
+
             // message-destination-ref
             MessageDestinationRef resource = new MessageDestinationRef();
-            
+
             resource.setName(annotation.name());
             resource.setType(annotation.type().getCanonicalName());
-            
+
             resource.setUsage(annotation.mappedName());
             resource.setDescription(annotation.description());
-            
+
             context.getNamingResources().addMessageDestinationRef(resource);
-            
+
         } else if (annotation.type().getCanonicalName()
                 .equals("javax.resource.cci.InteractionSpec") ||
                 annotation.type().getCanonicalName()
                 .equals("javax.transaction.UserTransaction") ||
                 true) {
-            
+
             // resource-env-ref
             ContextResourceEnvRef resource = new ContextResourceEnvRef();
-            
+
             resource.setName(annotation.name());
             resource.setType(annotation.type().getCanonicalName());
-            
+
             resource.setProperty("mappedName", annotation.mappedName());
             resource.setDescription(annotation.description());
-            
+
             context.getNamingResources().addResourceEnvRef(resource);
-            
+
         }
-        
-        
+
+
     }
-    
-    
+
+
 }

Modified: tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/WebRuleSet.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -78,17 +78,17 @@ public class WebRuleSet extends RuleSetB
      * The <code>SetSessionConfig</code> rule used to parse the web.xml
      */
     protected SetSessionConfig sessionConfig = new SetSessionConfig();
-    
-    
+
+
     /**
      * The <code>SetLoginConfig</code> rule used to parse the web.xml
      */
     protected SetLoginConfig loginConfig = new SetLoginConfig();
 
-    
+
     /**
      * The <code>SetJspConfig</code> rule used to parse the web.xml
-     */    
+     */
     protected SetJspConfig jspConfig = new SetJspConfig();
 
 
@@ -256,7 +256,7 @@ public class WebRuleSet extends RuleSetB
 
          digester.addCallMethod(fullPrefix + "/listener/listener-class",
                                 "addListener", 0);
-         
+
         digester.addRule(fullPrefix + "/jsp-config",
                          jspConfig);
 
@@ -375,7 +375,7 @@ public class WebRuleSet extends RuleSetB
                               "setServletClass", 0);
         digester.addCallMethod(fullPrefix + "/servlet/servlet-name",
                               "setServletName", 0);
-        
+
         digester.addObjectCreate(fullPrefix + "/servlet/multipart-config",
                                  "org.apache.catalina.deploy.MultipartDef");
         digester.addSetNext(fullPrefix + "/servlet/multipart-config",
@@ -395,7 +395,7 @@ public class WebRuleSet extends RuleSetB
         digester.addCallMethod(fullPrefix + "/servlet/enabled",
                                "setEnabled", 0);
 
-        
+
         digester.addRule(fullPrefix + "/servlet-mapping",
                                new CallMethodMultiRule("addServletMapping", 2, 0));
         digester.addCallParam(fullPrefix + "/servlet-mapping/servlet-name", 1);
@@ -473,7 +473,7 @@ public class WebRuleSet extends RuleSetB
         //ejb-ref
         digester.addObjectCreate(fullPrefix + "/ejb-ref",
                                  "org.apache.catalina.deploy.ContextEjb");
-        digester.addSetNext(fullPrefix + "/ejb-ref", 
+        digester.addSetNext(fullPrefix + "/ejb-ref",
                             "addEjbRef",
                             "org.apache.catalina.deploy.ContextEjb");
         digester.addCallMethod(fullPrefix + "/ejb-ref/description",
@@ -656,7 +656,7 @@ public class WebRuleSet extends RuleSetB
 
 
 /**
- * Rule to check that the <code>login-config</code> is occurring 
+ * Rule to check that the <code>login-config</code> is occurring
  * only 1 time within the web.xml
  */
 final class SetLoginConfig extends Rule {
@@ -679,7 +679,7 @@ final class SetLoginConfig extends Rule 
 
 
 /**
- * Rule to check that the <code>jsp-config</code> is occurring 
+ * Rule to check that the <code>jsp-config</code> is occurring
  * only 1 time within the web.xml
  */
 final class SetJspConfig extends Rule {
@@ -702,7 +702,7 @@ final class SetJspConfig extends Rule {
 
 
 /**
- * Rule to check that the <code>session-config</code> is occurring 
+ * Rule to check that the <code>session-config</code> is occurring
  * only 1 time within the web.xml
  */
 final class SetSessionConfig extends Rule {
@@ -809,7 +809,7 @@ final class SetPublicIdRule extends Rule
 
         m.invoke(top, (Object [])paramValues);
         if (digester.getLogger().isDebugEnabled())
-            digester.getLogger().debug("" + top.getClass().getName() + "." 
+            digester.getLogger().debug("" + top.getClass().getName() + "."
                                        + method + "(" + paramValues[0] + ")");
 
     }
@@ -883,7 +883,7 @@ final class CallParamMultiRule extends C
 final class CallMethodMultiRule extends CallMethodRule {
 
     protected int multiParamIndex = 0;
-    
+
     public CallMethodMultiRule(String methodName, int paramCount, int multiParamIndex) {
         super(methodName, paramCount);
         this.multiParamIndex = multiParamIndex;
@@ -891,11 +891,11 @@ final class CallMethodMultiRule extends 
 
     /**
      * Process the end of this element.
-     * 
-     * @param namespace the namespace URI of the matching element, or an 
+     *
+     * @param namespace the namespace URI of the matching element, or an
      *   empty string if the parser is not namespace aware or the element has
      *   no namespace
-     * @param name the local name if the parser is namespace aware, or just 
+     * @param name the local name if the parser is namespace aware, or just
      *   the element name otherwise
      */
     @Override
@@ -909,18 +909,18 @@ final class CallMethodMultiRule extends 
             parameters = new Object[0];
             super.end(namespace, name);
         }
-        
+
         ArrayList<?> multiParams = (ArrayList<?>) parameters[multiParamIndex];
-        
+
         // Construct the parameter values array we will need
         // We only do the conversion if the param value is a String and
-        // the specified paramType is not String. 
+        // the specified paramType is not String.
         Object paramValues[] = new Object[paramTypes.length];
         for (int i = 0; i < paramTypes.length; i++) {
             if (i != multiParamIndex) {
-                // convert nulls and convert stringy parameters 
+                // convert nulls and convert stringy parameters
                 // for non-stringy param types
-                if(parameters[i] == null || (parameters[i] instanceof String 
+                if(parameters[i] == null || (parameters[i] instanceof String
                         && !String.class.isAssignableFrom(paramTypes[i]))) {
                     paramValues[i] =
                         IntrospectionUtils.convert((String) parameters[i], paramTypes[i]);
@@ -950,17 +950,17 @@ final class CallMethodMultiRule extends 
             sb.append(")");
             throw new org.xml.sax.SAXException(sb.toString());
         }
-        
+
         if (multiParams == null) {
             paramValues[multiParamIndex] = null;
             IntrospectionUtils.callMethodN(target, methodName, paramValues,
-                    paramTypes);   
+                    paramTypes);
             return;
         }
-        
+
         for (int j = 0; j < multiParams.size(); j++) {
             Object param = multiParams.get(j);
-            if(param == null || (param instanceof String 
+            if(param == null || (param instanceof String
                     && !String.class.isAssignableFrom(paramTypes[multiParamIndex]))) {
                 paramValues[multiParamIndex] =
                     IntrospectionUtils.convert((String) param, paramTypes[multiParamIndex]);
@@ -968,9 +968,9 @@ final class CallMethodMultiRule extends 
                 paramValues[multiParamIndex] = param;
             }
             IntrospectionUtils.callMethodN(target, methodName, paramValues,
-                    paramTypes);   
+                    paramTypes);
         }
-        
+
     }
 
 }
@@ -979,7 +979,7 @@ final class CallMethodMultiRule extends 
 
 /**
  * A Rule that check if the annotations have to be loaded.
- * 
+ *
  */
 
 final class IgnoreAnnotationsRule extends Rule {
@@ -1009,7 +1009,7 @@ final class IgnoreAnnotationsRule extend
 
 /**
  * A Rule that records the spec version of the web.xml being parsed
- * 
+ *
  */
 
 final class VersionRule extends Rule {
@@ -1023,7 +1023,7 @@ final class VersionRule extends Rule {
         throws Exception {
         WebXml webxml = (WebXml) digester.peek(digester.getCount() - 1);
         webxml.setVersion(attributes.getValue("version"));
-        
+
         if (digester.getLogger().isDebugEnabled()) {
             digester.getLogger().debug
                 (webxml.getClass().getName() + ".setVersion( " +
@@ -1038,39 +1038,39 @@ final class VersionRule extends Rule {
  * A rule that logs a warning if absolute ordering is configured.
  */
 final class AbsoluteOrderingRule extends Rule {
-    
+
     public AbsoluteOrderingRule() {
         // NO-OP
     }
-    
+
     @Override
     public void begin(String namespace, String name, Attributes attributes)
             throws Exception {
         digester.getLogger().warn(
                 WebRuleSet.sm.getString("webRuleSet.absoluteOrdering"));
-    } 
+    }
 }
 
 /**
  * A rule that logs a warning if relative ordering is configured.
  */
 final class RelativeOrderingRule extends Rule {
-    
+
     public RelativeOrderingRule() {
         // NO-OP
     }
-    
+
     @Override
     public void begin(String namespace, String name, Attributes attributes)
             throws Exception {
         digester.getLogger().warn(
                 WebRuleSet.sm.getString("webRuleSet.relativeOrdering"));
-    } 
+    }
 }
 
 /**
  * A Rule that sets soap headers on the ContextHandler.
- * 
+ *
  */
 final class SoapHeaderRule extends Rule {
 
@@ -1081,10 +1081,10 @@ final class SoapHeaderRule extends Rule 
     /**
      * Process the body text of this element.
      *
-     * @param namespace the namespace URI of the matching element, or an 
+     * @param namespace the namespace URI of the matching element, or an
      *   empty string if the parser is not namespace aware or the element has
      *   no namespace
-     * @param name the local name if the parser is namespace aware, or just 
+     * @param name the local name if the parser is namespace aware, or just
      *   the element name otherwise
      * @param text The body text of this element
      */
@@ -1106,7 +1106,7 @@ final class SoapHeaderRule extends Rule 
 
 /**
  * A Rule that sets service qname on the ContextService.
- * 
+ *
  */
 final class ServiceQnameRule extends Rule {
 
@@ -1117,10 +1117,10 @@ final class ServiceQnameRule extends Rul
     /**
      * Process the body text of this element.
      *
-     * @param namespace the namespace URI of the matching element, or an 
+     * @param namespace the namespace URI of the matching element, or an
      *   empty string if the parser is not namespace aware or the element has
      *   no namespace
-     * @param name the local name if the parser is namespace aware, or just 
+     * @param name the local name if the parser is namespace aware, or just
      *   the element name otherwise
      * @param text The body text of this element
      */
@@ -1139,20 +1139,20 @@ final class ServiceQnameRule extends Rul
         contextService.setServiceqnameLocalpart(localpart);
         contextService.setServiceqnameNamespaceURI(namespaceuri);
     }
-    
+
 }
 
 /**
- * A rule that checks if the taglib element is in the right place. 
+ * A rule that checks if the taglib element is in the right place.
  */
 final class TaglibLocationRule extends Rule {
 
     final boolean isServlet24OrLater;
-    
+
     public TaglibLocationRule(boolean isServlet24OrLater) {
         this.isServlet24OrLater = isServlet24OrLater;
     }
-    
+
     @Override
     public void begin(String namespace, String name, Attributes attributes)
             throws Exception {
@@ -1166,5 +1166,5 @@ final class TaglibLocationRule extends R
         }
     }
 
-    
+
 }
\ No newline at end of file

Modified: tomcat/trunk/java/org/apache/catalina/startup/XmlErrorHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/XmlErrorHandler.java?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/XmlErrorHandler.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/XmlErrorHandler.java Sat Oct 22 21:11:34 2011
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ public class XmlErrorHandler implements 
 
     private Set<SAXParseException> errors =
         new HashSet<SAXParseException>();
-    
+
     private Set<SAXParseException> warnings =
         new HashSet<SAXParseException>();
 
@@ -53,12 +53,12 @@ public class XmlErrorHandler implements 
         // Collect warnings
         warnings.add(exception);
     }
-    
+
     public Set<SAXParseException> getErrors() {
         // Internal use only - don't worry about immutability
         return errors;
     }
-    
+
     public Set<SAXParseException> getWarnings() {
         // Internal use only - don't worry about immutability
         return warnings;

Modified: tomcat/trunk/java/org/apache/catalina/startup/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/mbeans-descriptors.xml?rev=1187791&r1=1187790&r2=1187791&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/mbeans-descriptors.xml (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/mbeans-descriptors.xml Sat Oct 22 21:11:34 2011
@@ -22,19 +22,19 @@
          domain="Catalina"
          group="Listener"
          type="org.apache.catalina.startup.ContextConfig">
-    
+
     <attribute name="className"
                description="Fully qualified class name of the managed object"
                type="java.lang.String"
                writeable="false"/>
-               
+
     <attribute name="defaultContextXml"
                description="The location of the default context file"
-               type="java.lang.String"/>  
+               type="java.lang.String"/>
 
     <attribute name="defaultWebXml"
                description="The location of the default deployment descriptor"
-               type="java.lang.String"/>     
+               type="java.lang.String"/>
 
   </mbean>
 
@@ -48,7 +48,7 @@
                description="Fully qualified class name of the managed object"
                type="java.lang.String"
                writeable="false"/>
-      
+
   </mbean>
 
 
@@ -57,7 +57,7 @@
          domain="Catalina"
          group="Listener"
          type="org.apache.catalina.startup.HostConfig">
-    
+
     <attribute name="className"
                description="Fully qualified class name of the managed object"
                type="java.lang.String"
@@ -75,22 +75,22 @@
     <attribute name="contextClass"
                description="The Java class name of the Context implementation we should use"
                type="java.lang.String"/>
-               
+
      <attribute name="copyXML"
                description="The copy XML config file flag for this component"
                is="true"
                type="boolean"/>
-               
+
      <attribute name="deployXML"
                description="The deploy XML config file flag for this component"
                is="true"
                type="boolean"/>
-               
+
      <attribute name="unpackWARs"
                description="The unpack WARs flag"
                is="true"
                type="boolean"/>
-               
+
     <operation name="addServiced"
                description="Add a web application to the serviced list to show it gets serviced by another component"
                impact="ACTION"
@@ -99,7 +99,7 @@
                  description="Application name"
                  type="java.lang.String"/>
     </operation>
-      
+
     <operation name="check"
                description="Check a web application name for updates"
                impact="ACTION"
@@ -108,7 +108,7 @@
                  description="Application name"
                  type="java.lang.String"/>
     </operation>
-    
+
     <operation name="getDeploymentTime"
                description="Get the instant where an application was deployed"
                impact="ACTION"
@@ -126,7 +126,7 @@
                  description="Application name"
                  type="java.lang.String"/>
     </operation>
-    
+
     <operation name="isServiced"
                description="Is a web application serviced by another component"
                impact="ACTION"



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


Mime
View raw message