public class DefaultAccessDeniedHandler implements AccessDeniedHandler {
private String errorPage;
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException)
throws IOException, ServletException {
boolean isAjax = (request);
if(isAjax){
Message msg = (accessDeniedException);
(response, msg);
}else if (!()) {
if (errorPage != null) {
(WebAttributes.ACCESS_DENIED_403, accessDeniedException);
(HttpServletResponse.SC_FORBIDDEN);
RequestDispatcher dispatcher = (errorPage);
(request, response);
} else {
(HttpServletResponse.SC_FORBIDDEN, ());
}
}
}
public void setErrorPage(String errorPage) {
if ((errorPage != null) && !("/")) {
throw new IllegalArgumentException("errorPage must begin with '/'");
}
this.errorPage = errorPage;
}
}