HttpServletRequest request, HttpServletResponse response)
throws ViewHandlerException {
// some containers call filters on EVERY request, even forwarded ones,
// so let it know that it came from the control servlet
if (request == null) {
throw new ViewHandlerException("Null HttpServletRequest object");
}
if ((page == null) || (page.length() == 0)) {
throw new ViewHandlerException("Null or empty source");
}
request.setAttribute("_FORWARDED_FROM_CONTROL_SERVLET_",
new Boolean(true));
RequestDispatcher rd = request.getRequestDispatcher(page);
if (rd == null) {
throw new ViewHandlerException(
"Source returned a null dispatcher (" + page + ")");
}
try {
rd.forward(request, response);
} catch (IOException ie) {
throw new ViewHandlerException("IO Error in view", ie);
} catch (ServletException e) {
Throwable throwable = (e.getRootCause() != null) ? e.getRootCause()
: e;
if (throwable instanceof JspException) {
JspException jspe = (JspException) throwable;
throwable = (jspe.getRootCause() != null) ? jspe.getRootCause()
: jspe;
}
Debug.logError(throwable, "ServletException rendering JSP view");
throw new ViewHandlerException(e.getMessage(), throwable);
}
}