1、编写Action,继承自DispatchAction
将execute方法改为其他名字
2.struts-config.xml中的<action标签中加入一个请求参数parameter="名字aaa"
3.jsp页面中增加一个隐藏域,里面也有一个请求参数:
<html:form action="...">
<input type="hidden" name="名字aaa" value="action中的某个方法名"
</html:form>
错误写法:url?opType="findAll"
正确写法:url?opType=findAll
本文介绍如何在 Struts 框架中通过修改 Action 的 execute 方法名称,并在 struts-config.xml 中设置请求参数,以及在 JSP 页面使用隐藏域传递自定义方法名来实现特定功能调用的方法。
427

被折叠的 条评论
为什么被折叠?



