在JSP文件中的同一个form表单有多个用来提交表单值的按钮,用户可以通过不同的按钮提交表单,需要调用Action中的不同处理方法,该怎么使用动态方法调用?

Action

function formSubmit(){
document.form1.method="post";
var url ="<%=request.getContextPath()%>/hrt/chartSichuan.do?method=recordList";
document.form1.action= url;
document.form1.submit();
}

可以把你的提交按钮改成的type 属性改成button,然后给这个button添加一个onclick事件,通过javascript来控制跳转到不同的action
location.href="Action?method=add";
location.href="Action?method=delete";

DMI actionName!methodName.action

这个通过struts不是很简单吗?

struts1还是struts2?struts1的话用js动态修改url的method参数就可以了,struts2的话需要用js动态修改form的action名称

location.href="emp!findall";
location.href="emp!save";
比如: 新增的form表单

/s:textfield
/s:textfield
/s:submit
/s:form
修改的form表单:

/s:hidden
/s:textfield
/s:textfield
/s:submit
/s:form

struts.xml配置文件
<!--这里的emp跟你action叹号前面的必须一致,叹号后面的跟你action里面的方法名称对应-->
/emplist.jsp
/new.jsp
/update.jsp
emp!findall

EmpAction代码:
public class EmpAction extends ActionSupport {

List list;
Emp e;
public Emp getE() {
    return e;
}

public void setE(Emp e) {
    this.e = e;
}

public List getList() {
    return list;
}

public void setList(List list) {
    this.list = list;
}

public String findall(){
    list = EmpDao.findAllEmp();

    return SUCCESS;
}
public String newEmp(){
    list = EmpDao.findAllDept();

    return "new";
}
public String save(){
    EmpDao.insertEmp(e);
    return "ok";
}
public String toupdate(){
    e=EmpDao.findAllEmpById(e);
    list = EmpDao.findAllDept();
    return "toupdate";
}
public String update(){
    EmpDao.updateEmp(e);
    return "ok";
}

}