private static RequestDispatcher getRequestDispatcher(PageContext pc, String relPath) throws PageServletException { RequestDispatcher disp = pc.getServletContext().getRequestDispatcher(relPath); if (disp == null) throw new PageServletException(new ApplicationException("Page " + relPath + " not found")); return disp; }
public static void forward(PageContext pc, String relPath) throws ServletException, IOException { ServletContext context = pc.getServletContext(); relPath = HTTPUtil.optimizeRelPath(pc, relPath); try { pc.getHttpServletRequest().setAttribute("lucee.forward.request_uri", relPath); RequestDispatcher disp = context.getRequestDispatcher(relPath); if (disp == null) throw new PageServletException(new ApplicationException("Page " + relPath + " not found")); // populateRequestAttributes(); disp.forward(removeWrap(pc.getHttpServletRequest()), pc.getHttpServletResponse()); } finally { ThreadLocalPageContext.register(pc); } }