日期:2014-05-19  浏览次数:20622 次

struts1怎么从第一个action里跳转到另一个action
最近刚接触struts1,不知道怎样在执行完第一个action以后,跳转到第二个action里,继续执行第二个action内容
  看下代码吧
  return new ActionForward("others.do?reqCode=findall"); 是不是这样?
  还是这样 return mapping.findForward("others.do?reqCode=findall");
  struts.xml是这样的
<action-mappings>
<action name="OthersForm" parameter="reqCode" path="/others"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">

<forward name="findall" path="/jsp/others/list.jsp"/>

</action>
</action-mappings>
  页面这样的form 
<form action="${ctx}/others.do" method="post" id="form name="form">
  可能这个问题很小白,本人真的不懂,最好能详细点


------解决方案--------------------
两个 action: A B
action A你已经配置了,action B你也配置好了
现在要从A 跳到B,只需将A的配置中<forward>标签中path属性,配置为B的action标签中的path属性