}
if (url.equals("/")) {
showNoApprovedContent(httpResponse);
return;
}
ConfigEntity config = ctx.getConfig();
if (!StringUtils.isEmpty(config.getSite404Url())) {
page = getPage(config.getSite404Url(), httpRequest);
if (page != null) {
renderPage(httpRequest, httpResponse, page, url);
}
}
httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
catch (AccessDeniedException e) {
HttpSession session = httpRequest.getSession(true);
String userEmail = (String)session.getAttribute(
AuthenticationFilter.USER_SESSION_ATTR);
UserEntity user = getDao().getUserDao().getByEmail(userEmail);
ConfigEntity config = ctx.getConfig();
if (user != null) {
renderMessage(httpResponse, Messages.get("access_denied_page"));
return;
}
if (StringUtils.isEmpty(config.getSiteUserLoginUrl())) {
renderMessage(httpResponse, Messages.get("login_not_configured"));
return;
}
session.setAttribute(AuthenticationFilter.ORIGINAL_VIEW_KEY,
httpRequest.getRequestURI());
httpResponse.sendRedirect(httpRequest.getContextPath()
+ config.getSiteUserLoginUrl());
}
}