use of lucee.runtime.exp.PageServletException in project Lucee by lucee.
the class BodyTagTryCatchFinallySupport method doCatch.
/**
* @see javax.servlet.jsp.tagext.TryCatchFinally#doCatch(java.lang.Throwable)
*/
@Override
public void doCatch(Throwable t) throws Throwable {
if (t instanceof PageServletException) {
final PageServletException pse = (PageServletException) t;
t = pse.getPageException();
}
if (bodyContent != null) {
final Excepton util = CFMLEngineFactory.getInstance().getExceptionUtil();
if (util.isOfType(Excepton.TYPE_ABORT, t))
bodyContent.writeOut(bodyContent.getEnclosingWriter());
bodyContent.clearBuffer();
}
throw t;
}
use of lucee.runtime.exp.PageServletException in project Lucee by lucee.
the class HTTPUtil method forward.
public static void forward(PageContext pc, String realPath) throws ServletException, IOException {
ServletContext context = pc.getServletContext();
realPath = HTTPUtil.optimizeRealPath(pc, realPath);
try {
pc.getHttpServletRequest().setAttribute("lucee.forward.request_uri", realPath);
RequestDispatcher disp = context.getRequestDispatcher(realPath);
if (disp == null)
throw new PageServletException(new ApplicationException("Page " + realPath + " not found"));
// populateRequestAttributes();
disp.forward(removeWrap(pc.getHttpServletRequest()), pc.getHttpServletResponse());
} finally {
ThreadLocalPageContext.register(pc);
}
}
Aggregations