Hi,
I want to customize the System Messages,then I Override getSystemMessages() in Application ,following the guide of vaadin book.
public static SystemMessages getSystemMessages() {
CustomizedSystemMessages messages = new CustomizedSystemMessages();
messages.setCommunicationErrorCaption(null);
messages.setCommunicationErrorMessage(i18n.getMsg("error.communicationError"));
messages.setCommunicationErrorNotificationEnabled(true);
messages.setInternalErrorCaption(null);
messages.setInternalErrorMessage(i18n.getMsg("error.internalError"));
messages.setInternalErrorNotificationEnabled(true);
messages.setOutOfSyncCaption(null);
messages.setOutOfSyncMessage(i18n.getMsg("error.outofsync"));
messages.setOutOfSyncNotificationEnabled(true);
messages.setSessionExpiredCaption(null);
messages.setSessionExpiredMessage(i18n.getMsg("error.sessionExpired"));
messages.setSessionExpiredNotificationEnabled(true);
return messages;
}
InternalError and OutOfSync work,But SessionExpied and CommunicationError not work.
Then I Override criticalNotification in AbstractApplicationServlet.
protected void criticalNotification(HttpServletRequest request,
HttpServletResponse response, String caption, String message,
String details, String url) throws IOException {
if("Communication problem".equals(caption)){
caption = null;
message = i18n.getMsg("error.communicationError");
details = null;
}else if("Session Expired".equals(caption)){
caption = null;
message = i18n.getMsg("error.sessionExpired");
details = null;
}
super.criticalNotification(request, response, caption, message, details, url);
}
It seems work correctly at first.
[b]
Yesterday,the network is down suddenly when users are doing some operation,then they see the notification with default System Messages supported by vaadin,not the CustomizedSystemMessages.But some users do not understand any english.
It seems the CustomizedSystemMessages not work.
How to make CustomizedSystemMessages work with network problem?Any solution?
[/b]