If you want that your application does a URL redirection on session expiration, you have to add the following kind of static method to your application class:
public static SystemMessages getSystemMessages() {
CustomizedSystemMessages m = new CustomizedSystemMessages();
m.setSessionExpiredCaption(null);
m.setSessionExpiredMessage(null);
m.setSessionExpiredURL("http://www.google.com");
return m;
}
Thanks for your response. It work perfectly when we have a Refresher but have no effect when refresher sleep (for exemple, on login page). So it’s a part of the solution
Hello,
has anybody a nice solution how to set the SessionExpiredURL containing the current context path ?
Lets say I have another servlet inside my vaadin app.
I can find no way to access the context path in the static method.
I’ve stored it in an ThreadLocal, but after the session is lost, the thread is lost.
Probably this should be part of CustomizedSystemMessages
Yes, if I omit the contextPath the AbstractApplicationServlet redirects to “/otherServletUrl” (without contextPath).
See: AbstractApplicationServlet.handleServiceSessionExpired
The contextPath should actually by added to all static SystemMessages (sessionExpiredURL, communicationErrorURL, internalErrorURL, outOfSyncURL, cookiesDisabledURL).