HttpServletResponse httpResponse, WaybackRequest wbRequest,
WaybackException exception, ResultURIConverter uriConverter)
throws ServletException, IOException {
httpRequest.setAttribute("exception", exception);
UIResults uiResults = new UIResults(wbRequest,uriConverter,exception);
boolean handled = false;
if((wbRequest != null) && !wbRequest.isReplayRequest()) {
if(wbRequest.isXMLMode()) {
uiResults.forward(httpRequest, httpResponse, xmlErrorJsp);
handled = true;
}
} else if (requestIsEmbedded(httpRequest, wbRequest)) {
// try to not cause client errors by sending the HTML response if
// this request is ebedded, and is obviously one of the special
// types:
handled = true;
if (requestIsJavascript(httpRequest, wbRequest)) {
uiResults.forward(httpRequest, httpResponse,
javascriptErrorJsp);
} else if (requestIsCSS(httpRequest, wbRequest)) {
uiResults.forward(httpRequest, httpResponse, cssErrorJsp);
} else if (requestIsImage(httpRequest, wbRequest)) {
uiResults.forward(httpRequest, httpResponse, imageErrorJsp);
} else {
handled = false;
}
}
if(!handled) {
uiResults.forward(httpRequest, httpResponse, errorJsp);
}
}