MappingDispachAction的编写流程:
1 编写处理类时,继承MappingDispachAction,不覆盖execute方法,提供多个自定义的处理方法
。方法签名必须和execute一样
public ActionForward findAll(ActionMapping mapping, ActionForm form,
HttpServletRequest req, HttpServletResponse resp) throws Exception {
IPersonMgmtDAO dao = new PersonMgmtDAOImpl();
List<Person> persons = dao.findAllPersons();
req.getSession().setAttribute("persons", persons);
return mapping.findForward("showAllPersonsPage");
}
2 在struts-config.xml中配置额外表示方法名的参数
<action .... parameter="具体的方法名findAll">