Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add load-on-startup configuration for custom Vaadin servlet #1712

Merged
merged 3 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions articles/advanced/i18n-localization.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ mvn jetty:run -Dvaadin.i18n.provider=com.vaadin.example.ui.TranslationProvider
When using the annotation, you could have the servlet class as:
[source,java]
----
@WebServlet(urlPatterns = "/*", name = "slot", asyncSupported = true, initParams = {
@WebInitParam(name = Constants.I18N_PROVIDER, value = "com.vaadin.example.ui.TranslationProvider") })
@WebServlet(urlPatterns = "/*", name = "slot", asyncSupported = true, loadOnStartup = 1,
initParams = { @WebInitParam(name = Constants.I18N_PROVIDER, value = "com.vaadin.example.ui.TranslationProvider") })
public class ApplicationServlet extends VaadinServlet {
}
----
Expand All @@ -49,6 +49,7 @@ Or, using the [filename]#web.xml# file:
<servlet-class>
com.vaadin.flow.server.VaadinServlet
</servlet-class>
<load-on-startup>1</load-on-startup>

<init-param>
<param-name>i18n.provider</param-name>
Expand Down
5 changes: 3 additions & 2 deletions articles/configuration/npm-pnpm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Alternatively, you can use the Servlet 3.0 `@WebServlet` annotation:

[source,java]
----
@WebServlet(urlPatterns = "/*", name = "myservlet", asyncSupported = true, initParams = {
@WebInitParam(name = "pnpm.enable", value = "true") })
@WebServlet(urlPatterns = "/*", name = "myservlet", asyncSupported = true, loadOnStartup = 1,
initParams = { @WebInitParam(name = "pnpm.enable", value = "true") })
public class CustomServlet extends VaadinServlet {
}
----
Expand All @@ -88,6 +88,7 @@ or use the traditional [filename]#web.xml# file:
<servlet-class>
com.vaadin.flow.server.VaadinServlet
</servlet-class>
<load-on-startup>1</load-on-startup>

<init-param>
<param-name>pnpm.enable</param-name>
Expand Down
4 changes: 3 additions & 1 deletion articles/configuration/properties.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ You can use the Servlet 3.0 `@WebServlet` annotation, which requires you to conf

[source,java]
----
@WebServlet(urlPatterns = "/*", name = "myservlet", asyncSupported = true, initParams = {
@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 {
Expand All @@ -73,6 +74,7 @@ Yet another approach is to use the [filename]#web.xml# file:
<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>
Expand Down
2 changes: 1 addition & 1 deletion articles/integrations/embedding/exporter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public final class UserService {

[source,java]
----
@WebServlet(urlPatterns = { "/vaadin/*" })
@WebServlet(urlPatterns = { "/vaadin/*" }, asyncSupported = true, loadOnStartup = 1)
public class WebComponentVaadinServlet extends VaadinServlet {
}
----
Expand Down