HttpServletRequest接口有一个RequstDispatcher
ServletContext接口有一个RequstDispatcher
不同的是HttpServletRequest可以用绝对与相对路径来表示,
而ServletContext只可以用绝对路径表示。
可以用request.getRequestDispatcher()得到HttpServletRequest接口的
可以用this.getServletContext().getRequestDispatcher()或者
ServletContext ctx=getServletContext();
方法得到ServletContext接口的

解决方案 »

  1.   

    它可以进行重定向,包含等操作.就相当于jsp里的include和forward
      

  2.   

    作用就是在容器上下文中做转发,例如从这个页面跳转到别的SERVLET页面。就跟ASP中的response.redirect或PHP中的header("location:a.php");相似的功能,但比他们强大的多。
      

  3.   

    可以用this.getServletContext().getRequestDispatcher()或者
    ServletContext ctx=getServletContext();
    ctx.getRequestDispatcher();
    方法得到ServletContext接口的刚刚少写了一句:P