is it possible, and how, to replace default “Internal error, please notify adminstrator …” popup with automatic page refresh?
I’m getting some strange client side errors that I don’t really have time to solve right now.
Can I straight up call page refresh with JS by using the following code:
private void attached() {
UI.getCurrent().getSession().getService().setSystemMessagesProvider(new SystemMessagesProvider() {
@Override
public SystemMessages getSystemMessages(SystemMessagesInfo systemMessagesInfo) {
logger.error(systemMessagesInfo.toString());
UI.getCurrent().getPage().executeJs("something someting");
CustomizedSystemMessages c = new CustomizedSystemMessages();
return c;
}
});
}
If you set the CustomizedSystemMessages’s relevant message and caption to null, it should automatically redirect to the URL. For example:
CustomizedSystemMessages messages = new CustomizedSystemMessages();
messages.setSessionExpiredMessage(null);
messages.setSessionExpiredCaption(null);
messages.setSessionExpiredURL("some-url");
In this case, a session expired message should automatically result into navigation to some-url. Same goes for the other message types in CustomizedSystemMessages.