Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

vaadin user management

aaa bbb
10 years ago Jan 18, 2012 9:49am
Mathias Clerc
10 years ago Jan 19, 2012 12:44am

You can store data which would go into the session into the Application object.

Using this technique has several implication :

  • Application might need to be serialized/deserialized by some containers so every data you add in there need to be serializable too (or transient)
  • You can't use getApplication in components constructor. getApplication returns null until the component has been attached (by setContent or addComponent) to it. So if you need to access your "session data" or your user object at that time, you will have to find some other way to do it (pass the instance to the constructor, ThreadLocal, ...)

See this chapter of the book for more details.

aaa bbb
10 years ago Jan 19, 2012 8:43am
aaa bbb
10 years ago Jan 19, 2012 3:16pm
Petrus Viljoen
10 years ago Jan 19, 2012 5:12pm
Bobby Bissett
10 years ago Jan 19, 2012 6:16pm
aaa bbb
10 years ago Jan 20, 2012 10:13am