SEC-324: Ensure IllegalStateException no longer occurs.
This commit is contained in:
parent
324789d544
commit
7313d5def0
|
@ -62,22 +62,14 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
|
||||||
|
|
||||||
// Perform RequestDispatcher "forward"
|
// Perform RequestDispatcher "forward"
|
||||||
RequestDispatcher rd = request.getRequestDispatcher(errorPage);
|
RequestDispatcher rd = request.getRequestDispatcher(errorPage);
|
||||||
|
|
||||||
try {
|
|
||||||
rd.forward(request, response);
|
rd.forward(request, response);
|
||||||
((HttpServletResponse) response).setStatus(HttpServletResponse.SC_FORBIDDEN);
|
|
||||||
|
|
||||||
return;
|
|
||||||
} catch (Exception responseCommitted) {
|
|
||||||
if (logger.isErrorEnabled()) {
|
|
||||||
logger.error("Error processing " + request.toString(), responseCommitted);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!response.isCommitted()) {
|
||||||
// Send 403 (we do this after response has been written)
|
// Send 403 (we do this after response has been written)
|
||||||
((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
|
((HttpServletResponse) response).sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The error page to use. Must begin with a "/" and is interpreted relative to the current context root.
|
* The error page to use. Must begin with a "/" and is interpreted relative to the current context root.
|
||||||
|
|
Loading…
Reference in New Issue