]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't scan classpath for any development servlet (#14604)
authorLeif Åstrand <leif@vaadin.com>
Thu, 4 Sep 2014 10:09:59 +0000 (13:09 +0300)
committerVaadin Code Review <review@vaadin.com>
Thu, 4 Sep 2014 11:40:25 +0000 (11:40 +0000)
Change-Id: If3db4a35609260beff1079cbaafa8827643d9271

WebContent/WEB-INF/web.xml
uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java

index 18c06795c01ba14cb6ae4d0ece2168d01b0a90be..ef6036420203e644a12ac2e64aa1ef90a6fd33cc 100644 (file)
             <param-name>application</param-name>
             <param-value>com.vaadin.tests.components.button.Buttons</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <async-supported>true</async-supported>
     </servlet>
     <servlet>
             <param-name>UI</param-name>
             <param-value>com.vaadin.tests.components.label.MarginsInLabels</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <async-supported>true</async-supported>
     </servlet>
     <servlet>
             <param-name>UI</param-name>
             <param-value>com.vaadin.tests.VerifyAssertionsEnabled</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <async-supported>true</async-supported>
     </servlet>
 
             <param-name>legacyPropertyToString</param-name>
             <param-value>false</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <init-param>
             <param-name>heartbeatInterval</param-name>
             <param-value>301</param-value>
             because it modifies the VaadinService timeout parameters -->
         <servlet-name>VaadinApplicationRunnerWithTimeoutRedirect</servlet-name>
         <servlet-class>com.vaadin.launcher.ApplicationRunnerServlet</servlet-class>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
     </servlet>
 
     <servlet>
             <param-name>pushmode</param-name>
             <param-value>automatic</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <async-supported>true</async-supported>
     </servlet>
 
             <param-name>UI</param-name>
             <param-value>com.vaadin.tests.integration.ServletIntegrationUI</param-value>
         </init-param>
-        <init-param>
-            <param-name>org.atmosphere.cpr.scanClassPath</param-name>
-            <param-value>false</param-value>
-        </init-param>
         <async-supported>true</async-supported>
     </servlet>
 
index e6e54a57a624dc08174d0c47aa0007e8b4dd8362..22b075b8907e68488a1cf88dc80ddd9cab114714 100644 (file)
@@ -48,6 +48,7 @@ import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.servlet.ServletHolder;
 import org.eclipse.jetty.util.Scanner;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.eclipse.jetty.webapp.WebAppContext;
@@ -273,6 +274,19 @@ public class DevelopmentServerLauncher {
             }
         }
 
+        // Read web.xml to find all configured servlets
+        webappcontext.start();
+
+        // Reconfigure all servlets to avoid startup delay
+        for (ServletHolder servletHolder : webappcontext.getServletHandler()
+                .getServlets()) {
+            if (servletHolder
+                    .getInitParameter("org.atmosphere.cpr.scanClassPath") == null) {
+                servletHolder.setInitParameter(
+                        "org.atmosphere.cpr.scanClassPath", "false");
+            }
+        }
+
         try {
             server.start();