我第一次使用struts,
问题是,我的 java 类中有一个 ActionForward 执行方法,
在我的 jsp 页面中,我调用另一个操作 fooAction
,它也在我的 java 类中声明
tag:page namePag="<%=pagnum%>"
urlAccion="/foo.do?dispatch=fooAction"
idParam="numPage" />
尽管如此,我的 jsp 中的每个操作都会定向到 execute
方法,如果我更改 execute
方法的名称,页面将重定向到空白页面,
那么如何删除/重命名 execute
方法而不影响功能
最佳答案
In struts V1.1, by default it executes the "Execute Method". If you are very particular to redirect the request to a defined page.
Do this change in action mapping attribute
<action path="/fooAction" type="org.apache.struts.actions.ForwardAction" parameter="/pages/fooActionJsp.jsp"/>
Point the jsp to the appropriate page using the parameter
关于java - 如何替换执行 ActionForward 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23015792/