}
// include page using filter response
RequestDispatcher rd = pageContext.getServletContext().getRequestDispatcher(fullPath);
PageRequestWrapper pageRequest = new PageRequestWrapper((HttpServletRequest) pageContext.getRequest());
PageResponseWrapper pageResponse = new PageResponseWrapper((HttpServletResponse) pageContext.getResponse(), factory);
StringBuffer sb = new StringBuffer(contentType != null ? contentType : "text/html");
if (encoding != null) {
sb.append(";charset=").append(encoding);
}
pageResponse.setContentType(sb.toString());
// if rd == null, then the panel was not found, but this isn't correct, so we need to spit out
// something appropriate. What this is, well...I don't know yet.
if (rd == null) {
throw new ApplyDecoratorException("The specified resource in applyDecorator tag (" + fullPath + ") was not found.");
}
rd.include(pageRequest, pageResponse);
pageObj = pageResponse.getPage();
}
// If pageObj == null, then the panel source had some weird error in
// it. Stop writing bugs like this. They're ugly and they make you smell funny.
if (pageObj == null) {