From 3a5fc58c6e7d96b8a08de9bd7dac79872c131d59 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Wed, 14 Sep 2022 08:43:11 +0200 Subject: [PATCH] fix: set load-on-startup for automatically registered Vaadin servlet (#398) When using Vite, DevModeInitializer blocks dev-server startup until a VaadinServlet is deployed because it needs to get the servlet path to use. If the container lazily loads servlets, Vite will not start until the first HTTP request for the Vaadin servlet is received. This change sets load-on-startup feature for automatically deployed Vaadin servlet, to ensure that the servlet and Vite are loaded on the startup of the Web application Part of vaadin/flow#14479 --- vaadin-cdi/src/main/java/com/vaadin/cdi/CdiServletDeployer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/vaadin-cdi/src/main/java/com/vaadin/cdi/CdiServletDeployer.java b/vaadin-cdi/src/main/java/com/vaadin/cdi/CdiServletDeployer.java index 451bc2d0..070a3648 100644 --- a/vaadin-cdi/src/main/java/com/vaadin/cdi/CdiServletDeployer.java +++ b/vaadin-cdi/src/main/java/com/vaadin/cdi/CdiServletDeployer.java @@ -85,6 +85,7 @@ public void onStartup(Set> classSet, ServletContext ctx) { registration.setAsyncSupported(true); registration.addMapping("/*"); + registration.setLoadOnStartup(1); } private static ServletRegistration findRootServlet(ServletContext context) {