We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.flow.server.startup.
Package com.vaadin.flow.server.startup
Class ServletDeployer
java.lang.Object
com.vaadin.flow.server.startup.ServletDeployer
All Implemented Interfaces:
jakarta.servlet.ServletContextListener
, EventListener
Context listener that automatically registers Vaadin servlets.
The servlets registered are:
- Vaadin application servlet, mapped to '/*'
The servlet won't be registered, if anyVaadinServlet
is registered already or if there are no classes annotated withRoute
annotation. - Static files servlet, mapped to '/VAADIN/static' responsible to resolve files placed in the '[webcontext]/VAADIN/static' folder or in the '[classpath]/META-INF/static' location. It prevents sensible files like 'stats.json' and 'flow-build-info.json' to be served. It manages cache headers based on the '.cache.' and '.nocache.' fragment in the file name.
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
InitParameters.DISABLE_AUTOMATIC_SERVLET_REGISTRATION
system property
is set to true
.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextDestroyed
(jakarta.servlet.ServletContextEvent sce) void
contextInitialized
(jakarta.servlet.ServletContextEvent sce)
-
Constructor Details
-
ServletDeployer
public ServletDeployer()
-
-
Method Details
-
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent sce) Specified by:
contextInitialized
in interfacejakarta.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent sce) Specified by:
contextDestroyed
in interfacejakarta.servlet.ServletContextListener
-