HttpServletResponse response) {
String path = request.getPathInfo();
ModelAndView model = new ModelAndView(path);
HttpSession session = request.getSession(false);
response.setStatus(HttpServletResponse.SC_OK);
final AuthenticationException ae = (session != null) ? (AuthenticationException) session
.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION) : null;
String errmsg = "";
if (ae != null) {
errmsg = ae.getMessage();
} else {
AccessDeniedException accessDenied = (AccessDeniedException) request
.getAttribute(WebAttributes.ACCESS_DENIED_403);
if (accessDenied != null) {
errmsg = CapAppContext.getMessage("AccessCheck.AccessDenied",