Configuration Properties
Vaadin applications have configuration properties that change their behavior. You can use either system properties or servlet initialization parameters to set them. See the full list of properties for details.
Tip
|
Spring Applications
See the Spring-specific instructions for Spring-based applications.
|
Using System Properties
When using Java system properties to set Vaadin application parameters, the vaadin.
prefix must be specified before the parameter names. The following example shows how to set the pnpm.enable
system property when executing a Maven goal from the command-line:
mvn jetty:run -Dvaadin.pnpm.enable=true
You can configure system properties for Maven plugin executions. For instance, the following example sets a Vaadin-specific system property when running the Jetty Maven plugin:
<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 servlet unless you want it done automatically by Vaadin with default parameter values.
@WebServlet(urlPatterns = "/*", name = "myservlet", asyncSupported = true, loadOnStartup = 1,
initParams = { @WebInitParam(name = "pnpm.enable", value = "true") })
public class MyServlet extends VaadinServlet {
}
Yet another approach is to use the web.xml
file.
<?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>pnpm.enable</param-name>
<param-value>true</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.
The system property is used when a system property and a servlet parameter have the same name.
|
Configuration Properties
The following list contains the properties that are defined in com.vaadin.server.DeploymentConfiguration
and com.vaadin.server.Constants
classes in alphabetical order.
Note
|
Spring Boot Applications
If you use Spring Boot, you should add the vaadin. prefix. For example, vaadin.productionMode=true .
|
Property Name | Description | Default Value |
| Decide whether pre-compressed Brotli files should be used if accepted by the browser. Brotli files are created during a production build and the property is only used in production mode. Set to |
|
| Decide whether |
|
| Close the Vaadin session if no UI is active. A UI is considered active if it is open on the client-side and has any activity in addition to heartbeat requests. By default, heartbeat requests keep the Vaadin session open even when there is no user interaction. Set to |
|
| Enable live reload. When using a server-side live reload tool, the browser is automatically refreshed after code is rebuilt on the server. Set to |
|
| Optimize front-end resource bundles. All front-end resources in the classpath are included in the generated bundle in development mode by default. When set to |
|
| Enable session serialization. When session serialization is enabled, |
|
| Enable Vaadin to collect usage statistics that are used to guide further development. Statistics are collected based on features that are used in the application. No data is collected in production mode. Some usage statistics are collected through the web browser. See the client-side collector repository for instructions on how to opt out. This only applies to development mode. |
|
| Disable automatic servlet registration required by Vaadin applications. You must register Vaadin servlets yourself if set to |
|
| Disable cross-site request forgery protection. The protection is enabled by default and you should keep it enabled unless for certain types of testing. |
|
| Enable the client-side bootstrap page to include the initial JSON data fragment. |
|
| Enable development using the front-end development server instead of an application bundle. This only applies to development mode. |
|
| Set the heartbeat interval time. UIs that are open on the client-side send a regular heartbeat to the server indicating that they are still active even without 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 value is expressed in | 300 seconds (5 minutes) |
| Set the fully-qualified name for the internationalization provider class. To translate strings for localization, the application should implement the |
|
| Set the maximum time in | 5000 ms (5 seconds) |
| Enable |
|
| Set the application to work in production mode. It disables most of the logged information that appears on the server and browser console to improve performance. Development mode JavaScript functions aren’t exported. Any |
|
| Set the timeout in |
|
| Enable server push. The permitted values are "disabled", "manual", or "automatic". See Server Push for more information. |
|
| Specify the servlet mapping used for bidirectional ("push") client-server communication. Some Java application servers require special context, for example for websockets, which you can specify here. |
|
| Include basic timing information in responses that can be used for performance testing. |
|
| Enable 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. It’s set to |
|
| Set the number of | 300 seconds (5 minutes) |
27BF72FB-1E23-42B0-B540-A602F9AD4571