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
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#