public ActionForward deleteInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String path = "lost";
if(a.equals("test")){
RequestDispatcher rd = request.getRequestDispatcher("test.do");
rd.forward(request, response);
//return null;我这里没有加return;if条件满足,然后转到的是test.do,
                            //而不上面的"lost",请问是怎么回事
}
return mapping.findForward(path);
}

解决方案 »

  1.   

     rd.forward(request, response);
    forward本来就是重新定向的它会丢弃后面的response,return也当然不会执行了
      

  2.   

    request.getRequestDispatcher("test.do").forward(request, response);这是重定向的一种而已
      

  3.   

    不是的
    因为我在
    return mapping.findForward(path);
    前面加了一句
    System.out.println("12123123");
    return mapping.findForward(path);他执行rd.forward(request, response);
    后已经就结束了啊为什么还出了12123123这句话啊
      

  4.   

    我只确定mapping.findForward这个方法跳转之后肯定不再会执行其后得内容,具体request.getRequestDispatcher这个方法之后是否执行那就不清楚了楼主去查下文档前提是你程序已经跳转到test.do
      

  5.   

    的确 跳转到test.do
    而且也打出了12123123
      

  6.   

    试下重定向
    response.sendRedirect("")