可以一个form对应多个action,但是传过来的变量都要放在form中不太好管理,主要是看你怎么使用
解决方案 »
- 请问我在做联通SGIP短信MO发送时,报java.lang.NegativeArraySizeException
- 【求助】如何把这个sql语句变成hql语句啊?
- <新手问题>hibernate如何用外键进行查找?
- 分页问题
- 请教各位高手一个关于分布存储数据的问题
- 那位大哥知道类似GOOGLE,查询的下拉提示是怎么做的,用什么技术可以实现啊,怎么实现,求代码
- 请问这个报错怎么解决?
- 请问ant支持C/C++构建吗?
- JTable中选择行并删除行的问题
- velocity输出数字计算结果
- spring一个测试程序在eclipse转向netbeans后出现的问题
- org.apache.commons.httpclient.HttpMethodDirector executeWithRetry的问题
关键是配置文件的写法!
同事告诉我这样配置:<form-bean name="aform" type="com.safety.struts.form.AForm" />
<form-bean name="bform" type="com.safety.struts.form.BForm" />
<action
attribute="aform"
name="aform"
path="/A"
parameter="hMethod"
scope="request"
type="com.safety.struts.action.AAction"
validate="false"> <forward name="initDirect" path="/experience/experience_main.jsp" />
</action>
<action
attribute="bForm"
name="bForm"
path="/B"
parameter="hMethod"
scope="request"
type="com.safety.struts.action.AAction"
validate="false">
<forward name="editArchivesDirect" path="/archives/archives_edit.jsp" />
</action>就是配置多个 <action> type属性是同一个类,
只取自己感兴趣的属性就好了!
当然多个Form要有相似性!
<script type="text/javascript">
function tea(){
document.form1.action="userRegister.do?method=RegisterZhanghao";
document.form1.submit();
}
</script>
</head>
<form action="userRegister.do?method=PutLeaveWordRubbish" method="post" name="form1" id="form1">
<input type="buttion" onclick="tea()" value="提交">
</form>