Class CdiServletDeployer

  • All Implemented Interfaces:
    javax.servlet.ServletContainerInitializer

    public class CdiServletDeployer
    extends Object
    implements javax.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 Detail

      • CdiServletDeployer

        public CdiServletDeployer()
    • Method Detail

      • onStartup

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