Vaadin cache issue

I have an example application with three steps below

Enter user data β†’ Personal data β†’ Done

When I click on the link, it will link to my vaadin application. The problem is that my three-step process is complete, and when I tried to click on my vaadin link again, it still shows the last page of the Finish wizard

(you need to clear the browser cache or restart the browser if I want to see the first page again. i. Enter the user information wizard page)

+4
source share
3 answers

Since Vaadin stores the session in memory, your application is not reset until it sees a new browser session (i.e., a cleared cache or a restarted browser). Another way to clear a session during development is to enable reloading of the application to your application URL. This will also clear the state of the application.

So, keeping in mind, it’s clear that if you like that the state of the Vaadin application is reset during normal use, you need to make sure programmatically that the internal logic works the way it is done. For instance. call the self-defined reset () method for your first view.

Make sure that you do not confuse this state of the session-based application with the state of the page that resets the application each time you click reload or reopen the link without creating a new browser session.

A section in Vaadin's book about this: http://vaadin.com/book/-/page/architecture.server-side.html

+9
source

Just add the restartApplication parameter to your URL when calling your application in the browser. for example, if you call your application as localhost: 8080 / myvaadinapp /, then try calling localhost: 8080 / myvaadinapp /? restartApplication.

He tells Vaadin Servlet to create a new instance of the application when the page loads.

0
source

You can write a servlet that simply initializes the session / vaadin application. You can use this as a post url. It can be redirected to your vaadin application.

-1
source

Source: https://habr.com/ru/post/1335940/


All Articles