From 7a0a8b598945f4efa4c3b9526b5ce656f4218579 Mon Sep 17 00:00:00 2001 From: mukherjeesudebi Date: Mon, 14 Apr 2025 16:02:55 +0300 Subject: [PATCH 1/6] Vaadin-Refresh --- .../advanced/modifying-the-bootstrap-page.adoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index a10611ae7d..22a988f786 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -202,6 +202,20 @@ public class AppShell implements AppShellConfigurator { Modifications in [methodname]`AppShellConfigurator.configurePage()` have priority over the equivalent annotations. Annotations don't cover all of the cases that can be achieved when overriding the [methodname]`AppShellConfigurator.configurePage()` method. +==== Vaadin-Refresh[[vaadin-refresh]] + +If the XHR response cannot be parsed as JSON, Vaadin will look for a Vaadin-Refresh string anywhere inside the response text. If it's present, then Vaadin will reload the page instead of showing an error message. The refresh token can be added as meta tag. + +[source,java] +---- +public class AppShell implements AppShellConfigurator { + + @Override + public void configurePage(AppShellSettings settings) { + settings.addMetaTag("refresh", "Vaadin-Refresh"); + } +} +---- === `IndexHtmlRequestListener` Interface [[IndexHtmlRequestListener-interface]] From d84289a66fc28750d08797d21689e97c2e4e0ef3 Mon Sep 17 00:00:00 2001 From: mukherjeesudebi Date: Tue, 15 Apr 2025 16:45:37 +0300 Subject: [PATCH 2/6] updated vaadin-refresh description --- articles/flow/advanced/modifying-the-bootstrap-page.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index 22a988f786..d42ee2433f 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -204,7 +204,7 @@ Modifications in [methodname]`AppShellConfigurator.configurePage()` have priorit ==== Vaadin-Refresh[[vaadin-refresh]] -If the XHR response cannot be parsed as JSON, Vaadin will look for a Vaadin-Refresh string anywhere inside the response text. If it's present, then Vaadin will reload the page instead of showing an error message. The refresh token can be added as meta tag. +If the XHR response cannot be parsed as JSON, Vaadin looks for a Vaadin-Refresh string anywhere inside the response text. If it is present, then Vaadin reloads the page instead of showing an error message. The refresh token can be added as meta tag. [source,java] ---- From 6669e0c6d37e4dd980053f661c4c0424eb95340d Mon Sep 17 00:00:00 2001 From: Jouni Koivuviita Date: Wed, 16 Apr 2025 11:36:29 +0300 Subject: [PATCH 3/6] edit language --- articles/flow/advanced/modifying-the-bootstrap-page.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index d42ee2433f..e7b2a211c5 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -204,7 +204,7 @@ Modifications in [methodname]`AppShellConfigurator.configurePage()` have priorit ==== Vaadin-Refresh[[vaadin-refresh]] -If the XHR response cannot be parsed as JSON, Vaadin looks for a Vaadin-Refresh string anywhere inside the response text. If it is present, then Vaadin reloads the page instead of showing an error message. The refresh token can be added as meta tag. +If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. You can add the refresh token as a meta tag. [source,java] ---- From 52585d19ba23d4905de87d5e2528932c1acd64a6 Mon Sep 17 00:00:00 2001 From: mukherjeesudebi Date: Thu, 17 Apr 2025 11:18:32 +0300 Subject: [PATCH 4/6] changed heading --- articles/flow/advanced/modifying-the-bootstrap-page.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index e7b2a211c5..6e54a43146 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -202,7 +202,7 @@ public class AppShell implements AppShellConfigurator { Modifications in [methodname]`AppShellConfigurator.configurePage()` have priority over the equivalent annotations. Annotations don't cover all of the cases that can be achieved when overriding the [methodname]`AppShellConfigurator.configurePage()` method. -==== Vaadin-Refresh[[vaadin-refresh]] +==== Forcing a Page Reload After an Invalid Server Response[[vaadin-refresh]] If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. You can add the refresh token as a meta tag. From 3fcf3fc1f42b81bf88cf1ae71522cb5c07c30e0e Mon Sep 17 00:00:00 2001 From: mukherjeesudebi Date: Mon, 23 Jun 2025 13:32:47 +0300 Subject: [PATCH 5/6] html sample for vaadin-refresh token --- .../modifying-the-bootstrap-page.adoc | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index 6e54a43146..bc15797601 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -204,7 +204,27 @@ Modifications in [methodname]`AppShellConfigurator.configurePage()` have priorit ==== Forcing a Page Reload After an Invalid Server Response[[vaadin-refresh]] -If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. You can add the refresh token as a meta tag. +If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. Usually such responses are served by some 3rd party servers and then you need to add the refresh token as a meta tag to the html page served by it. + +Sample HTML response with the meta tag + +[source,xml] +---- + + + + + + + Vaadin App + + +

Invalid server response

+ + +---- + +But sometimes due to proxy or firewall timeout, a new session is served for the client, without the client being aware of that. In such cases you need to add the refresh token in Vaadin bootstrap page. [source,java] ---- From d020fe85db9139d2e8e8c977fb790de5aab86df5 Mon Sep 17 00:00:00 2001 From: mukherjeesudebi Date: Tue, 24 Jun 2025 13:46:19 +0300 Subject: [PATCH 6/6] updated to caps HTML --- articles/flow/advanced/modifying-the-bootstrap-page.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/flow/advanced/modifying-the-bootstrap-page.adoc b/articles/flow/advanced/modifying-the-bootstrap-page.adoc index bc15797601..95a4d8cc98 100644 --- a/articles/flow/advanced/modifying-the-bootstrap-page.adoc +++ b/articles/flow/advanced/modifying-the-bootstrap-page.adoc @@ -204,7 +204,7 @@ Modifications in [methodname]`AppShellConfigurator.configurePage()` have priorit ==== Forcing a Page Reload After an Invalid Server Response[[vaadin-refresh]] -If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. Usually such responses are served by some 3rd party servers and then you need to add the refresh token as a meta tag to the html page served by it. +If the XHR response can't be parsed as JSON, Vaadin looks for a “Vaadin-Refresh” string anywhere inside the response text. If it's present, Vaadin reloads the page instead of showing an error message. Usually such responses are served by some 3rd party servers and then you need to add the refresh token as a meta tag to the HTML page served by it. Sample HTML response with the meta tag