+ -
当前位置:首页 → 问答吧 → struts1 action问题~

struts1 action问题~

时间:2011-11-22

来源:互联网

比如下面一例:
  <action attribute="branchForm" 
  name="branchForm" 
  path="/branchDelete" //这个path什么含义,在地址栏里显示么,能举例下么?
  scope="request"
  type="com.asideal.struts.action.branch.BranchDeleteAction"
  validate="false">
  <set-property property="cancellable" value="true" />
  <forward name="success" path="/branch.do" /> //path这个.do转到哪里了,去哪看
  </action>


这个是struts2的:
  <action name="updateUser" 
  class="updateUserAction">
<result name="success" type="redirect">listUser.action</result> //这是struts2的
<result name="input">/update.jsp</result>
</action>

作者: pl_mm5   发布时间: 2011-11-22

引用楼主 pl_mm5 的回复:
比如下面一例:
<action attribute="branchForm"
name="branchForm"
path="/branchDelete" //这个path什么含义,在地址栏里显示么,能举例下么?
scope="request"
type="com.asid……

这里的path,值得是你要怎么跳转到这个action,如果你是用工具生成的,默认是.do。所以你要跳进到这个action的话就要这样http://....:8080/项目名/branchDelete.do这样就等于跳进action了,我不知道你的action是继承Action还是DisptchAction,如果你的是Action的话,那这样就可以了跳转了,如果是DisptchAction的话还要看你那边的情况了

<forward name="success" path="/branch.do" /> //path这个.do转到哪里了,去哪看
这是跳转到branchAction里面的execute方法

作者: oyxm0   发布时间: 2011-11-22