diff options
Diffstat (limited to 'documentation/application/application-lifecycle.asciidoc')
-rw-r--r-- | documentation/application/application-lifecycle.asciidoc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/documentation/application/application-lifecycle.asciidoc b/documentation/application/application-lifecycle.asciidoc index 7bace1cdfc..614b0db589 100644 --- a/documentation/application/application-lifecycle.asciidoc +++ b/documentation/application/application-lifecycle.asciidoc @@ -94,7 +94,6 @@ public class MyServlet extends VaadinServlet { protected void servletInitialized() throws ServletException { super.servletInitialized(); - ... } } @@ -104,7 +103,6 @@ To add custom functionality around request handling, you can override the [methodname]#service()# method. -ifdef::web[] [[application.lifecycle.servlet-service.servicecustomization]] === Customizing Vaadin Service @@ -112,8 +110,6 @@ To customize [classname]#VaadinService#, you first need to extend the [classname]#VaadinServlet# or - [classname]#Portlet# class and override the [methodname]#createServletService()# to create a custom service object. -endif::web[] - [[application.lifecycle.session]] == User Session @@ -346,15 +342,10 @@ when the timeout specified by the [parameter]#session-timeout# parameter of the servlet expires after the last non-heartbeat request. Once the session is gone, the browser will show an Out Of Sync error on the next server request. ((("redirection"))) -To avoid the ugly message, you may want to set a redirect URL for the UIs - -ifdef::web[] -, as described in +To avoid the ugly message, you may want to set a redirect URL for the UIs, as described in <<dummy/../../../framework/application/application-errors#application.errors.systemmessages,"Customizing System -Messages">> -endif::web[] -. +Messages">>. The related configuration parameters are described in <<dummy/../../../framework/application/application-environment#application.environment.parameters,"Other @@ -395,7 +386,7 @@ logout button, which closes the user session. public class MyUI extends UI { @Override protected void init(VaadinRequest request) { - setContent(new Button("Logout", event -> {// Java 8 + setContent(new Button("Logout", event -> { // Redirect this page immediately getPage().setLocation("/myapp/logout.html"); @@ -408,7 +399,6 @@ public class MyUI extends UI { } } ---- -See the http://demo.vaadin.com/book-examples-vaadin7/book#application.lifecycle.closing[on-line example, window="_blank"]. This is not enough. When a session is closed from one UI, any other UIs attached to it are left hanging. When the client-side engine notices that a UI and the @@ -419,9 +409,7 @@ and, by default, reloads the UI when the message is clicked. ((("system messages"))) You can customize the message and the redirect URL in the system messages. -ifdef::web[] It is described in <<dummy/../../../framework/application/application-errors#application.errors.systemmessages,"Customizing System Messages">>. -endif::web[] ((("heartbeat"))) ((("UI", "heartbeat"))) @@ -441,7 +429,7 @@ synchronized as described in public class MyPushyUI extends UI { @Override protected void init(VaadinRequest request) { - setContent(new Button("Logout", event -> {// Java 8 + setContent(new Button("Logout", event -> { for (UI ui: VaadinSession.getCurrent().getUIs()) ui.access(() -> { // Redirect from the page @@ -453,7 +441,6 @@ public class MyPushyUI extends UI { } } ---- -See the http://demo.vaadin.com/book-examples-vaadin7/book#application.lifecycle.closingall[on-line example, window="_blank"]. In the above example, we assume that all UIs in the session have push enabled and that they should be redirected; popups you might want to close instead of |