How to replace "Internal error" popup with automatic page refresh


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() {
			public SystemMessages getSystemMessages(SystemMessagesInfo systemMessagesInfo) {
				UI.getCurrent().getPage().executeJs("something someting");
				CustomizedSystemMessages c = new CustomizedSystemMessages();
				return c;


Maybe using the JS command location.reload() could help (didn’t try it myself).

Stefan Uebe:
Maybe using the JS command location.reload() could help (didn’t try it myself).

Yes I’m aware of the location.reload() call but I was wondering if anyone actually knows if this is the correct way to do this?

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();

In this case, a session expired message should automatically result into navigation to some-url. Same goes for the other message types in CustomizedSystemMessages.

Thanks, I’ll give it a shot!