예제 #1
0
파일: HTTPUtil.java 프로젝트: denuno/Lucee4
 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;
 }
예제 #2
0
파일: HTTPUtil.java 프로젝트: denuno/Lucee4
  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);
    }
  }