Class CdiServletDeployer

java.lang.Object
com.vaadin.cdi.CdiServletDeployer
All Implemented Interfaces:
jakarta.servlet.ServletContainerInitializer

public class CdiServletDeployer extends Object implements jakarta.servlet.ServletContainerInitializer
Container initializer that automatically registers a CDI Vaadin servlet. The servlet is only registered if all of the following conditions apply:
  • At least one class annotated with @Route is found on the classpath
  • No servlet is registered for /*
  • No Vaadin servlet is registered

Vaadin ships with ServletDeployer, which is a WebListener to register the default VaadinServlet. We can't override it from java, but since this class is a container initializer, we run first. After registration of the CDI Vaadin Servlet, the original deployer won't register the default one.

The rest of this class is copied from ServletDeployer.

  • Constructor Details

    • CdiServletDeployer

      public CdiServletDeployer()
  • Method Details

    • onStartup

      public void onStartup(Set<Class<?>> classSet, jakarta.servlet.ServletContext ctx)
      Specified by:
      onStartup in interface jakarta.servlet.ServletContainerInitializer