怎么从一个action跳到另一个action,跳的时候要带参数。
高手们帮帮忙,感激不尽

解决方案 »

  1.   

    你把参数放在session中不是很好吗!
      

  2.   

    requerst中
    seseion中
    ?传值
    方法很多撒
      

  3.   

    在config配置文件中要加
    parameter = "参数名"
      

  4.   

    *.do?参数名=值
    Eg   Expression.do?value(Modle)=list
      

  5.   

    你说从一个Action跳到另一个Action? 你想做什么呢?
    为什么不直接跳到第2个Action?
      

  6.   

    struts Action跳到Action是这样做的根据你xml配置的<forward name="test" path="/index/test.do" />
    用 mapping.findForward("test");跳转test就是forward name
    你想传值request.setAttribute("名", 值);放到request作用于里就好了
    在那个action Get出来,根本不需要url传值
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    // TODO Auto-generated method stub
    String id = request.getParameter("id");
    String step = request.getParameter("step");
    HttpSession session = request.getSession(true);
    if (id!=null && "".equals("id")!=true)
    {
    List list = tbiz.GetQuestionByqid(Integer.parseInt(id));
    session.setAttribute("qlist", list);
    request.setAttribute("step", list.get(0));
    request.setAttribute("s", 0);
    return mapping.findForward("test");
    }
    }<action path="/index/test" type="org.springframework.web.struts.DelegatingActionProxy">
          <forward name="test" path="/index/test.do" />
    </action>
      

  7.   

    给你一个例子,里面的参数也可以是${userName}的形式取得你Action里面的属性,记着在你的Action返回result的时候范围这个result name.
       <action name="gatherReportInfo" class="...">
          <result name="showReportResult" type="redirect-action">
             <param name="actionName">generateReport</param>
             <param name="namespace">/genReport</param>
             <param name="reportType">pie</param>
             <param name="width">100</param>
             <param name="height">100</param>
          </result>
       </action>
      

  8.   

    new ActionForward("action.do?param=&param=....");
    这样可以传更多参数
    如果通过配置文件后面只能够跟一个参数
      

  9.   

    <action name="aaction" path="/A.do" type="....">
    <forward name="" path="/B.do"/>
    <forward name="" path="/c.jsp"/>
    </action>