We tried to upgrade to 5.2.0, but noticed that Application class method setSessionExpiredURL has been removed. I researched this further and noticed that it has been replaced by a concept called SystemMessages. Application class instructs me to override the static method getSystemMessages, but this cannot be done! So there’s a design problem here.
So, I guess we cannot upgrade. Any plans on fixing this?
Thanks for the report. After some evaluation I would say that the design is correct, but the implementation did not handle application runner special case correctly. Fixed the issue and closed ticket.
Here is an example on how to use the API:
package com.itmill.toolkit.tests.tickets;
import com.itmill.toolkit.Application;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.Window;
public class Ticket1673 extends com.itmill.toolkit.Application {
public void init() {
final Window main = new Window("#1673");
setMainWindow(main);
main.addComponent(new Button("close", this, "close"));
}
public static Application.SystemMessages getSystemMessages() {
Application.CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages();
msgs.setSessionExpiredURL("http://www.itmill.com/");
msgs.setSessionExpiredCaption("Foo");
msgs.setSessionExpiredMessage("Bar");
return msgs;
}
}
I just noticed that the implementation was actually working with 5.2.0, so I jumped to conclusions before sending the ticket
Question: How do I make it work like it did before, i.e. when session expires I want to take the user directly to login screen and not show any system message? This was possible with the old implementation, but now I don’t see any way to get around the message box
That did the trick! But it was not very obvious. Maybe there should be a method like
showNotification(boolean) in the CustomizedSystemMessages to make it more understandable?