-
Book Overview & Buying
-
Table Of Contents
Vaadin 7 UI Design By Example: Beginner's Guide
A user session is like a place that Java web applications use to store data about each user. Each time a user access the application, a new session object is assigned to it. That means that each user has its own session. A session allows us to identify a user. It is a temporal storage where we (and Vaadin) can put data relevant to a user.
Because sessions are temporal, we can configure their lifetime (or timeout) in web.xml:
<web-app ...>
...
<session-config>
<session-timeout>20</session-timeout>
</session-config>
</web-app>Here, each session will last 20 minutes since the last time the user requested something to the server.
Vaadin automatically preserves the state of UI components (if @preserveOnRefresh is present) by storing the required UI data into the user session. We don't have to worry about preserving UI components state. However we can still use the user session to store stuff not covered by any UI component. For...
Change the font size
Change margin width
Change background colour