Configuration Properties
Vaadin applications have configuration properties that change their behavior. Use either system properties or servlet initialization parameters to set them. See the full list of properties.
For Spring-based applications, there are Spring-specific instructions available.
Using System Properties
When using Java’s system properties to set the Vaadin application parameters, the vaadin.
prefix needs to be specified before the parameter names. The following is an example of how to set a system property when executing a Maven goal from the command-line:
mvn jetty:run -Dvaadin.frontend.url.es6=http://mydomain.com/es6/ -Dvaadin.frontend.url.es5=http://mydomain.com/es5/
System properties can be configured for Maven plugin executions. For instance, the following sets a Vaadin-specific system property when the Jetty Maven plugin is run:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<systemProperties>
<systemProperty>
<name>vaadin.pushMode</name>
<value>disabled</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
Using Servlet Initialization Parameters
Another option is to use servlet initialization parameters. You can use the Servlet 3.0 @WebServlet
annotation, which requires you to configure your own servlet. Otherwise, it’s done automatically by Vaadin with default parameter values.
@WebServlet(urlPatterns = "/*", name = "myservlet", asyncSupported = true, loadOnStartup = 1,
initParams = {
@WebInitParam(name = "frontend.url.es6", value = "http://mydomain.com/es6/"),
@WebInitParam(name = "frontend.url.es5", value = "http://mydomain.com/es5/") })
public class MyServlet extends VaadinServlet {
}
Yet another approach is to use the web.xml
file like so:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id="WebApp_ID" version="3.0"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>
com.vaadin.flow.server.VaadinServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>frontend.url.es6</param-name>
<param-value>http://mydomain.com/es6/</param-value>
</init-param>
<init-param>
<param-name>frontend.url.es5</param-name>
<param-value>http://mydomain.com/es5/</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Note
|
System properties override servlet parameters
When a system property and a servlet parameter have the same name, the system property is used.
|
Configuration Properties
The following list contains the properties that are defined in the com.vaadin.server.DeploymentConfiguration
and com.vaadin.server.Constants
classes, in alphabetical order.
Note
|
Spring Boot
If you use Spring Boot, you should add the vaadin. prefix, for example, vaadin.productionMode=true .
|
Property name | Description | Default value |
| Checks whether pre-compressed Brotli files should be used if available. |
|
| When set to |
|
| If you are using a server-side live reload tool, the browser is automatically refreshed after the code is reloaded on the server. |
|
| By default in development mode, all front-end resources found in the classpath are included in the generated bundle. When set to |
|
| When session serialization is disabled, |
|
| Enables Vaadin to collect usage statistics that are used to guide development further. Statistics are collected based on features used in the application. No data is collected in production mode. Some versions of Vaadin also collect usage statistics through the web browser. See the documentation for the client-side collector for information on how to opt out of that part of the usage statistics collection. Only used in development mode. |
|
| Configuration name for the parameter that determines whether Vaadin should automatically register servlets that are required for the application to work. |
|
| Cross-site request forgery protection. The protection is enabled by default, but you may want to disable it for a certain type of testing. The check can be disabled by setting the init parameter. |
|
| If the client-side bootstrap page should include the initial UIDL fragment. |
|
| UIs that are open on the client-side send a regular heartbeat to the server indicating that they are still alive, even when there is no ongoing user interaction. When the server doesn’t receive a valid heartbeat from a given UI within a certain amount of time, it removes that UI from the session. The interval is expressed in | 300 seconds (this equals 5 minutes) |
| I18N provider property. To use localization and translation strings, the application only needs to implement |
|
| In certain cases, for example, when the server sends adjacent | 5000 ms |
| This flag can be used to enable |
|
| Sets the application to work in production mode. Production mode disables most of the logged information that appears on the console. Otherwise, logging and other debugging features can have a significant impact on performance. Development-mode JavaScript functions aren’t exported. A |
|
| Specifies how long it accepts responses after each network request in milliseconds when using the long polling transport strategy. |
|
| The permitted values are "disabled", "manual" or "automatic". See Server Push for more information. |
|
| Sets the servlet mapping used for bidirectional ("push") client-server communication. |
|
| If set to |
|
| Enables or disables sending URLs as GET and POST parameters in requests with content-type |
|
| Enables or disables sync ID checking. The sync ID is used to handle situations where the client sends a message to a connector that has been removed from the server. |
|
| This flag can be used to enable the server-side bootstrapping mode used in Vaadin 14 and earlier versions. This option is only supported if webpack is used as the front-end build tool instead of Vite, which is used by default. You can enable webpack using its associated feature flag. |
|
| Defines the number of seconds that a WebComponent waits for a reconnect before removing the server-side component from memory. | 300 seconds |
27BF72FB-1E23-42B0-B540-A602F9AD4571