com.vaadin.flow.server.startup.

Class ServletDeployer

  • All Implemented Interfaces:

    EventListener, javax.servlet.ServletContextListener


    public class ServletDeployer
    extends Object
    implements javax.servlet.ServletContextListener

    Context listener that automatically registers Vaadin servlets. The servlets registered are:

    • Vaadin application servlet, mapped to '/*'
      The servlet won't be registered, if any VaadinServlet is registered already or if there are no classes annotated with Route annotation.
    • Frontend files servlet, mapped to '/frontend/*'
      The servlet is registered when the application is started in the development mode or has Constants.USE_ORIGINAL_FRONTEND_RESOURCES parameter set to true.
    In addition to the rules above, a servlet won't be registered, if any servlet had been mapped to the same path already or if Constants.DISABLE_AUTOMATIC_SERVLET_REGISTRATION system property is set to true.

    Since:

    1.0

    Author:

    Vaadin Ltd

    See Also:

    VaadinServletConfiguration.disableAutomaticServletRegistration()

    • Constructor Detail

      • ServletDeployer

        public ServletDeployer()
    • Method Detail

      • contextInitialized

        public void contextInitialized(javax.servlet.ServletContextEvent sce)

        Specified by:

        contextInitialized in interface javax.servlet.ServletContextListener

      • contextDestroyed

        public void contextDestroyed(javax.servlet.ServletContextEvent sce)

        Specified by:

        contextDestroyed in interface javax.servlet.ServletContextListener