Skip to content

Commit

Permalink
docs: add more details about applicationIdentifier (#3656)
Browse files Browse the repository at this point in the history
* docs: add more details about applicationIdentifier

Explain how default application identifier is also hashed and prefixed with 'app-'.

* Update articles/flow/configuration/properties.adoc

Co-authored-by: Mikhail Shabarov <[email protected]>

* Initial edit of changed text.

* Editig all of document touched.

* Third pass -- editing all of document touched.

---------

Co-authored-by: Mikhail Shabarov <[email protected]>
Co-authored-by: Russell J.T. Dyer <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent 4eaf46a commit 70f4b59
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions articles/flow/configuration/properties.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ order: 10

= Configuration Properties

You can change the behavior of Vaadin applications by setting the configuration properties. You can set them either through the system properties, or the servlet initialization parameters. See the <<properties,full list of properties>> for details.
You can change the behavior of Vaadin applications by setting the configuration properties. Either set them through the system properties, or with the servlet initialization parameters. See the <<properties,full list of properties>> for details.

See also the <<{articles}/flow/integrations/spring/configuration#, Spring-specific instructions>> for Spring-based applications.


[[system-properties]]
== Using System Properties
== System Properties

When using Java system properties to set Vaadin application parameters, the `vaadin.` prefix must be specified before each parameter name. The following example shows how to set the `pnpm.enable` system property when executing a Maven goal from the command-line:
When using Java system properties to set Vaadin application parameters, the `vaadin.` prefix has to be specified before each parameter name. The following shows how to set the `pnpm.enable` system property when executing a Maven goal from the command-line:

[source,bash]
----
mvn jetty:run -Dvaadin.pnpm.enable=true
----

You can configure system properties for Maven plugin executions. For instance, the following sets a Vaadin-specific system property when running the Jetty Maven plugin:
You can also configure system properties for Maven plugin executions. For instance, the following sets a Vaadin-specific system property when running the Jetty Maven plugin:

[source,xml]
----
Expand All @@ -43,7 +43,7 @@ You can configure system properties for Maven plugin executions. For instance, t

== Servlet Initialization Parameters

Another option for setting configuration properties is to use servlet initialization parameters. Use the Servlet 3.0 `@WebServlet` annotation. This requires you to configure your servlet, unless you want Vaadin Flow to do it, using default parameter values.
Another option for setting configuration properties is to use servlet initialization parameters. Use the Servlet 3.0 `@WebServlet` annotation. This requires you to configure your servlet -- unless you want Vaadin Flow to do it -- using default parameter values.

[source,java]
----
Expand Down Expand Up @@ -85,14 +85,13 @@ Yet another approach is to use the [filename]`web.xml` file. Below is an example
</web-app>
----


.System Properties Override Servlet Parameters
[NOTE]
When a system property and a servlet parameter have the same name, the system property is used and the servlet parameter is ignored.
When a system property and a servlet parameter have the same name, the system property is used, while the servlet parameter is ignored.


[[properties]]
== Configuration Properties
== Properties Defined

The following table contains the properties that are defined in the [classname]`com.vaadin.server.DeploymentConfiguration` and [classname]`com.vaadin.flow.server.Constants` classes. They're listed in alphabetical order. If you use Spring Boot, you should add the `vaadin.` prefix to them (e.g., change `brotli` to `vaadin.brotli`).

Expand All @@ -102,19 +101,19 @@ The following table contains the properties that are defined in the [classname]`

|`applicationIdentifier`
|`default-project-id`
|Application identifier that's generated by default based on the project build settings (e.g., Maven's `groupId` and `artifactId`) -- during a production build. The property is used by the daily active users license model only for the moment. It can be configured by developers to differentiate end-users distribution between the same applications running in a cluster -- ones that have the same group and artifact IDs.
|Application identifier that's generated by default based on the project build settings (e.g., Maven's `groupId` and `artifactId`, the string value is hashed and prefixed with `app-`) -- during a production build. The property is used only for the moment by the daily active users license model. It can be configured by developers to differentiate end-users distribution between the same applications running in a cluster -- ones that have the same group and artifact IDs.

|`brotli`
|`true`
|Determines whether pre-compressed https://github.com/google/brotli[Brotli] files should be used if accepted by the browser. Brotli files are created during a production build. The property is used only in production mode. Set to `false` if you want to serve uncompressed static resources.

|`closeIdleSessions`
|`false`
|Closes the Vaadin session if no UI is active. A UI is considered active if it's open on the client-side and has any activity -- besides heartbeat requests. By default, heartbeat requests keep the Vaadin session open even when there is no user interaction. Set to `true` to close idle sessions. See `heartbeatInterval` below.
|Closes the Vaadin session if no UI is active. A UI is considered active if it's open on the client-side and has any activity -- besides heartbeat requests. By default, heartbeat requests keep the Vaadin session open even when there isn't any user interaction. Set to `true` to close idle sessions. See `heartbeatInterval` below.

|`devmode.hostsAllowed`
|`null`
|Defines the hosts allowed to access Vaadin development tools. A comma-separated list of allowed hosts should be provided as the value. The `?` and `\*` wildcards can be used (e.g., `192.168.1.*,172.17.?.*`). Loopback addresses are always allowed, regardless of the value set here.
|Defines the hosts allowed to access Vaadin development tools. A comma-separated list of allowed hosts should be provided as the value. The `?` and `*` wildcards can be used (e.g., `192.168.1.*,172.17.?.*`). Loopback addresses are always allowed, regardless of the value set here.

|`devmode.liveReload.enabled`
|`true`
Expand Down Expand Up @@ -210,8 +209,7 @@ The following table contains the properties that are defined in the [classname]`

|`sessionLockCheckStrategy`
|assert
|When production mode is enabled, the Vaadin session lock check is done according to this setting. By default, the check is done only if assertions are also enabled: this is to avoid the small performance impact of continuously checking the lock status. Alternative values are 'log' to log a warning, or 'throw' to fail with an `IllegalStateException`. The 'log' option also logs a full stack trace, enabling you to determine any problematic calls to Vaadin UI components from background threads. This is since Vaadin Flow version 24.4.

|When production mode is enabled, the Vaadin session lock check is done according to this setting. By default, the check is done only if assertions are also enabled: this is to avoid the small performance impact of checking continuously the lock status. Alternative values are 'log' to log a warning, or 'throw' to fail with an `IllegalStateException`. The 'log' option also logs a full stack trace, enabling you to determine any problematic calls to Vaadin UI components from background threads. This is since Vaadin Flow version 24.4.
|===


Expand Down

0 comments on commit 70f4b59

Please sign in to comment.