Custom Vaadin Session Timeout Handler
Override the com.vaadin.Application#getSystemMessages() method to add custom functionality.
public class CustomApplication extends com.vaadin.Application {
@Overrides
public static SystemMessages getSystemMessages() {
CustomizedSystemMessages msgs;
msgs = new CustomizedSystemMessages();
msgs.setSessionExpiredNotificationEnabled(false);
msgs.setSessionExpiredURL("javascript:handleSessionTimeout();");
return msgs;
}
}
On the client side, you can now use JavaScript and respond to this event:
function handleSessionTimeout() {
console.log("Foo - the session timed out!");
};Written by Ben Ripkens
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Java
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#