TimeZone timeZone = getContext().getTimeZone();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, getContext().getLocale());
dateFormat.setTimeZone(timeZone);
DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.MEDIUM, getContext().getLocale());
timeFormat.setTimeZone(timeZone);
RedirectResolution loginHistoryResolution = new RedirectResolution(LoginHistoryActionBean.class);
String loginHistoryUrl =
StringEscapeUtils.escapeHtml(
loginHistoryResolution.getUrl(getContext().getLocale()));
getContext().getMessages().add(new ScopedLocalizableMessage(LoginActionBean.class,
"loginSucceededWithLastLogin",
dateFormat.format(historicLogin.getDate()),
timeFormat.format(historicLogin.getDate()),
historicLogin.getIp(),
loginHistoryUrl));
}
if (requestedUrl != null) {
return new RedirectResolution(requestedUrl, false);
}
return new RedirectResolution(CardsActionBean.class);
}