请求转发request.getRequestDispatcher("").forward()与PageContext.forward("");有什么区别呢?
请求转发request.getRequestDispatcher("").forward()与PageContext.forward("");有什么区别呢?
请求转发request.getRequestDispatcher("").forward()与PageContext.forward("");有什么区别呢?
2015-10-28
RequestDispacher,forward method taking request & response as parameter & while getting request dispatcher we are giving path for forward resource,
RequestDispacher rd = request.getRequestDispacher("/resource.jsp");rd.forward(request,response);
and while forwarding through PageContext we are giving resource path to parameter of forward method,
PageContext.forward("/resource.jsp");
we can use RequestDispacher in Servlet as well as Jsp
but PageContext we can use in only jsp.
举报