posts - 29, comments - 0, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          在struts的ActionForward中添加參數

          Posted on 2007-05-28 15:32 change 閱讀(1026) 評論(0)  編輯  收藏

          引用:http://shidu.blogbus.com/logs/2004/12/540365.html

          配置文件大概如下:
          <action-mappings>
          <action path="/account"
          name="accountForm"
          parameter="action"
          scope="request"
          type="com.ai.uaap.admin.web.action.AccountAction">
          <forward name="listOK" path="/AccountMaster.jsp" />
          <forward name="removeOK" path="/account.do?action=list" redirect="true" />
          </action>

          我在執行完remove的方法之后的代碼是return mapping.findForward("removeOK")。這時就會訪問account.do?action=list這個地址,以前我想在account.do?action=list之后繼續添加參數(例如account.do?action=list&abc=123)不知道該怎么實現。

          今天看到一個資料給出了實現:
          String path = mapping.findForward("removeOK").getPath();
          ActionForward forward = new ActionForward(path + "&abc=123", true);
          //這里的true是Redirect
          return forward;

          主站蜘蛛池模板: 同心县| 樟树市| 兴安县| 麟游县| 彭泽县| 华亭县| 南通市| 美姑县| 子长县| 辰溪县| 灵石县| 长岭县| 鸡西市| 体育| 鄂温| 临高县| 普格县| 禹州市| 乌兰察布市| 揭西县| 玉环县| 永年县| 纳雍县| 芜湖市| 合水县| 连城县| 平凉市| 绍兴市| 延安市| 海阳市| 金昌市| 营口市| 钟山县| 玉树县| 张家口市| 平江县| 新源县| 收藏| 崇文区| 出国| 沧源|