开发者

Cache Problem in Vaadin

开发者 https://www.devze.com 2023-02-05 18:54 出处:网络
I have a sample application with three steps as below Enter user details -> Personal details -> Finished

I have a sample application with three steps as below

Enter user details -> Personal details -> Finished

When I click on a link it will invoke my vaadin application. The problem is once my three step process is finished and when I tried to again click on the 开发者_开发问答my vaadin link it still shows the final wizard page 'Finished'

(Browser cache needs to be cleared or browser needs to be restarted if I want to see again first page i.e. Enter user details wizard page)


Since Vaadin keeps the session in memory, your application is not reset until it sees a new browser session (i.e. cache cleared or browser restarted). One more way to clear the session during development is to att ?restartApplication to your application's URL. This will also clear the application state.

So with this in mind it is clear that if you like the Vaadin application state to be reset during normal usage of it, you have to programmatically make sure the internal logic works in a way that does this. E.g. call a self-defined reset() method for your first view.

Make sure you don't confuse this session based state of an application, with a page-state which resets an applicaton every time you press reload or open a link again without a new browser session being created.

Section in Book of Vaadin about this: http://vaadin.com/book/-/page/architecture.server-side.html


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

It tells Vaadin Servlet to create new instance of Application on loading the page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号