Skip to content

Commit

Permalink
fix: set load-on-startup for automatically registered Vaadin servlet (#…
Browse files Browse the repository at this point in the history
…398) (#410)

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

Co-authored-by: Marco Collovati <[email protected]>
  • Loading branch information
vaadin-bot and mcollovati authored Sep 14, 2022
1 parent 84f0df9 commit 373210c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void onStartup(Set<Class<?>> classSet, ServletContext ctx) {

registration.setAsyncSupported(true);
registration.addMapping("/*");
registration.setLoadOnStartup(1);
}

private static ServletRegistration findRootServlet(ServletContext context) {
Expand Down

0 comments on commit 373210c

Please sign in to comment.