Struts1
public class testAction extends Action{
public ActionForword execute(ActionMapping mapping,ActionForm from,HttpservletRequest request,
HttpServletResponse response) throws Exception{
System.out.println(this);
return mapping.findForwart("success");
}
}
输出com.struts1.action.IndexAction@3c35fd
Struts2
public class testAction extends Action{
public ActionForword execute(ActionMapping mapping,ActionForm from,HttpservletRequest request,
HttpServletResponse response) throws Exception{
System.out.println(this);
return mapping.findForwart("success");
}
}
com.struts2.action.IndexAction@1f327e
HttpServlet
public class testServlet extends HttpServlet{
protected void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
doPost(req,res);
}
protected void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
System.out.println(this);
}
}