/** * Return the context-relative URI of the error page for the specified * HTTP status code, if any; otherwise return <code>null</code>. * * @param status HTTP status code to look up */ @Override public String findStatusPage(int status) { ErrorPage errorPage = statusPages.get(Integer.valueOf(status)); if (errorPage!=null) { return errorPage.getLocation(); } return null; }
@Override @Deprecated public String findStatusPage(int status) { ErrorPage errorPage = findErrorPage(status); if (errorPage != null) { return errorPage.getLocation(); } return null; }
@Override @Deprecated public String findStatusPage(int status) { ErrorPage errorPage = findErrorPage(status); if (errorPage != null) { return errorPage.getLocation(); } return null; }
public String getProperty(String name) { String result; if (name.startsWith("errorCode.")) { int code = Integer.parseInt(name.substring(10)); ErrorPage ep = errorPageSupport.find(code); if (ep == null) { result = null; } else { result = ep.getLocation(); } } else if (name.startsWith("exceptionType.")) { String className = name.substring(14); ErrorPage ep = errorPageSupport.find(className); if (ep == null) { result = null; } else { result = ep.getLocation(); } } else { result = null; } return result; } }
public String getProperty(String name) { String result; if (name.startsWith("errorCode.")) { int code = Integer.parseInt(name.substring(10)); ErrorPage ep = errorPageSupport.find(code); if (ep == null) { result = null; } else { result = ep.getLocation(); } } else if (name.startsWith("exceptionType.")) { String className = name.substring(14); ErrorPage ep = errorPageSupport.find(className); if (ep == null) { result = null; } else { result = ep.getLocation(); } } else { result = null; } return result; } }
throw new IllegalArgumentException (sm.getString("standardContext.errorPage.required")); String location = errorPage.getLocation(); if ((location != null) && !location.startsWith("/")) { if (isServlet22()) {
/** * Add an error page for the specified error or Java exception. * * @param errorPage The error page definition to be added */ @Override public void addErrorPage(ErrorPage errorPage) { // Validate the input parameters if (errorPage == null) throw new IllegalArgumentException (sm.getString("standardContext.errorPage.required")); String location = errorPage.getLocation(); if ((location != null) && !location.startsWith("/")) { if (isServlet22()) { if(log.isDebugEnabled()) log.debug(sm.getString("standardContext.errorPage.warning", location)); errorPage.setLocation("/" + location); } else { throw new IllegalArgumentException (sm.getString("standardContext.errorPage.error", location)); } } errorPageSupport.add(errorPage); fireContainerEvent("addErrorPage", errorPage); }
/** * Add an error page for the specified error or Java exception. * * @param errorPage The error page definition to be added */ @Override public void addErrorPage(ErrorPage errorPage) { // Validate the input parameters if (errorPage == null) throw new IllegalArgumentException (sm.getString("standardContext.errorPage.required")); String location = errorPage.getLocation(); if ((location != null) && !location.startsWith("/")) { if (isServlet22()) { if(log.isDebugEnabled()) log.debug(sm.getString("standardContext.errorPage.warning", location)); errorPage.setLocation("/" + location); } else { throw new IllegalArgumentException (sm.getString("standardContext.errorPage.error", location)); } } errorPageSupport.add(errorPage); fireContainerEvent("addErrorPage", errorPage); }
if (sendErrorPage(errorPage.getLocation(), response)) {
if (sendErrorPage(errorPage.getLocation(), response)) {
request.getContext().getServletContext(); RequestDispatcher rd = servletContext.getRequestDispatcher(errorPage.getLocation()); sm.getString("standardHostValue.customStatusFailed", errorPage.getLocation())); return false;
request.getContext().getServletContext(); RequestDispatcher rd = servletContext.getRequestDispatcher(errorPage.getLocation()); sm.getString("standardHostValue.customStatusFailed", errorPage.getLocation())); return false;
request.getContext().getServletContext(); RequestDispatcher rd = servletContext.getRequestDispatcher(errorPage.getLocation());
errorPage.getExceptionType()); appendElement(sb, INDENT4, "location", errorPage.getLocation()); sb.append(" </error-page>\n");
response.setAppCommitted(false); request.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);
response.setAppCommitted(false); request.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);
response.setAppCommitted(false); request.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);
errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);
errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);
errorPage.getLocation()); request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ERROR);