if (!BooleanUtils.toBoolean(loggedIn)) {
try {
externalContext.getSessionMap().put(LOGGED_IN, Boolean.TRUE);
String forward = externalContext.getRequestContextPath() + "/faces/addressbook/start.xhtml";
externalContext.redirect(externalContext.encodeResourceURL(forward));
} catch (Exception e) {
LOG.error("", e);
String forward = externalContext.getRequestContextPath() + "/error.xhtml";
try {
externalContext.redirect(externalContext.encodeResourceURL(forward));