<action path="/EngageMajorIssue"
  type="com.three.web.action.applications.EngageMajorIssueAction"
  parameter="operate"
  scope="request">
  <forward name="listAllByPage" path="Engage.do"></forward>
 </action>

解决方案 »

  1.   

    没什么不好的,全都把action配置成forward的一定要注意不要出现死循环
      

  2.   

    没什么不好的啊。除非你不用Struts跳转,而是用的Ajax。楼上所说的死循环,就是跳到的Action,又Forward到了另外的一个Action,然后又Forword到了另外的一个Action……如此死循环。不过,现在struts1一般都是在老项目中遗留啊。基本都用struts2了么。
      

  3.   


    恩,我又想问,假如我用的是SSH,那么这样就成了action调用action,而我的事务开始是配置在service的方法里,那么岂不是要开两次事务.是不是这么回事啊?高手指点
      

  4.   

    是这样子的,严格说来,一个action处理一个请求,包含一个事务,如果你的两个action有线性关系,说明你的action不够抽象,把两个有线性关系的action分离,把他们需要共同用到的业务逻辑用一个普通的java类实现,两个action各自调用这个实现就是了
      

  5.   


    恩,是这么回事啊,不过我的(action1)delete和(action2)listAllByPage要从页面取得的参数不同,可是我又想action1执行完之后再跳回到action2要跳过去的页面,所以不得不跳转到action2我用的是DispatchAcyion
    public ActionForward delete(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    String[] trainIds = request.getParameterValues("delid");
    trainService.deleteTrain(trainIds);
    return this.listAllByPage(mapping, form, request, response); }this.listAllByPage(mapping, form, request, response);这是此action的另外一个方法,
    public ActionForward listAllByPage(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    String page = request.getParameter("page");
    String pcount = request.getParameter("pcount");
    UtilPage2 utilPage2 = trainService.findByPage(page,pcount);
    request.setAttribute("utilPage2", utilPage2);
    request.setAttribute("operate", "listAllByPage");
    return mapping.findForward("listByPage");
    }
    其中的utilPage2在service中已经被注入,而delete必须是在listAllByPage执行完之后才可能执行,所以每次delete之后,它能从spring里取出来以前的utilPage2.所以能跳过去刚才的页面并执行完删除.可是我不确定这样的调用this.listAllByPage(mapping, form, request, response);是不是规范?是否要想办法让delete从页面取得page和pcount..谢谢高手啦
      

  6.   

    通常情况,没什么不好,但是缺点不是没有1 http://topic.csdn.net/u/20110927/19/df2dd41b-8e8f-46e6-8b1e-10e65ac37fab.html?92183
    对新手来说,用forward容易因客户f5,重复提交
    2 效率上有点问题,每次forward到新的action,都会导致一次新的form的reset/populate/validate(request.getParameter("x")-->form.getX()的过程,称之为populate),如果表单复杂,容易出现性能问题,或者不易控制。你说的spring的问题有点类似