Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
I have a web application, which should - ideally - run all the day. That is, the user goes to the web site, logs in and then uses this application during the entire business day.
He logs out only at the end of the day, when he leaves the office.
Question: How can I setup a Vaadin application to support this kind of work, i. e. to prevent "Session expired" errors?
Thanks in advance
Either set the session timeout in the server to a long enough value or use polling to keep the session alive.
You can use the Refresher add-on or the standard ProgressIndicator component for keep-alive polling.
Or set a very long session timeout in your WEB-INF/web.xml, so 8 hours in minutes would be:
Thanks for the suggestions!
Marko Grönroos: You can use the Refresher add-on
Imagine I use the Refresher plugin and the user opens a web page and does nothing for a while.
But on the server something happens, which I want to display to the user (even if he doesn't reload the page).
I assume that if I use the Refresher add-on, I will be able to do this (e. g. display some message box, which is triggered by the server, not by the user).
Is this correct?
Well, the Refresher makes a request to the server and if the server has updated its UI state after the previous request, it will be updated in the browser. You may need to set the refresh rate rather short.
A more responsive solution is to use the ICEPush add-on, which can be used to update the browser immediately when the server has new data to show.