String path = “/raisins.jsp?orderno=5”;
RequestDispatcher rd = context.getRequestDispatcher(path);
rd.forward(request,response);     //跳转到path指定的页面

解决方案 »

  1.   

    楼上的好像掉了一行吧?我都是这样写的       String url="/jsp/jsp1.jsp";
           ServletContext sc = getServletContext();
           RequestDispatcher rd = sc.getRequestDispatcher(url);
           rd.forward(request,response);
      

  2.   

    如果你用struts
    还有
    mapping.findForward("page")
    不过这需要在servlet里面配置
    很安全的
    用户是看不到到底指向的具体页面
    简单的就是response.sendRedirect()
    比较安全
      

  3.   

    为什么不详细说一下呢
    String path = “/raisins.jsp?orderno=5”;
    RequestDispatcher rd = context.getRequestDispatcher(path);
    rd.forward(request,response);      
    还有
    rd.include(request,response)
    我遇见过,但我也没十分弄清楚他们的区别!