SEC-324: Ensure IllegalStateException no longer occurs.

This commit is contained in:
Ben Alex 2006-09-15 07:55:57 +00:00
parent 324789d544
commit 7313d5def0
1 changed files with 5 additions and 13 deletions

View File

@ -62,21 +62,13 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
// Perform RequestDispatcher "forward"
RequestDispatcher rd = request.getRequestDispatcher(errorPage);
try {
rd.forward(request, response);
((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
} catch (Exception responseCommitted) {
if (logger.isErrorEnabled()) {
logger.error("Error processing " + request.toString(), responseCommitted);
}
}
rd.forward(request, response);
}
// Send 403 (we do this after response has been written)
((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
if (!response.isCommitted()) {
// Send 403 (we do this after response has been written)
((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
}
}
/**