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);
}
forward本来就是重新定向的它会丢弃后面的response,return也当然不会执行了
因为我在
return mapping.findForward(path);
前面加了一句
System.out.println("12123123");
return mapping.findForward(path);他执行rd.forward(request, response);
后已经就结束了啊为什么还出了12123123这句话啊
而且也打出了12123123
response.sendRedirect("")