<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Java技術(shù)專區(qū)--Hilly

    http://blog.duyouyou.com
       :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 ::  :: 管理

    LookupDispatchAction使用示例

    Posted on 2006-07-20 18:01 duyouyou.com 閱讀(931) 評(píng)論(0)  編輯  收藏 所屬分類: web技術(shù)
    LookupDispatchAction

    public abstract class LookupDispatchAction
    extends DispatchAction

    An abstract Action that dispatches to the subclass mapped execute method. This is useful in cases where an HTML form has multiple submit buttons with the same name. The button name is specified by the parameter property of the corresponding ActionMapping. To configure the use of this action in your struts-config.xml file, create an entry like this:

       <action path="/test"
               type="org.example.MyAction"
               name="MyForm"
              scope="request"
              input="/test.jsp"
          parameter="method"/>
     

    which will use the value of the request parameter named "method" to locate the corresponding key in ApplicationResources. For example, you might have the following ApplicationResources.properties:

        button.add=Add Record
        button.delete=Delete Record
      

    And your JSP would have the following format for submit buttons:

       <html:form action="/test">
        <html:submit property="method">
          <bean:message key="button.add"/>
        </html:submit>
        <html:submit property="method">
          <bean:message key="button.delete"/>
        </html:submit>
      </html:form>
      

    Your subclass must implement both getKeyMethodMap and the methods defined in the map. An example of such implementations are:

      protected Map getKeyMethodMap() {
          Map map = new HashMap();
          map.put("button.add", "add");
          map.put("button.delete", "delete");
          return map;
      }
    
      public ActionForward add(ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException {
          // do add
          return mapping.findForward("success");
      }
    
      public ActionForward delete(ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException {
          // do delete
          return mapping.findForward("success");
      }
      

    Notes - If duplicate values exist for the keys returned by getKeys, only the first one found will be returned. If no corresponding key is found then an exception will be thrown. You can override the method unspecified to provide a custom handler. If the submit was cancelled (a html:cancel button was pressed), the custom handler cancelled will be used instead.

    ?

    Hold住
    主站蜘蛛池模板: 久久国产免费一区| 免费人成激情视频在线观看冫| 亚洲AV日韩AV永久无码色欲| 成人免费区一区二区三区| 91麻豆国产自产在线观看亚洲| 亚洲女人初试黑人巨高清| 久久成人18免费网站| 91免费精品国自产拍在线不卡| 亚洲国产精品一区二区第一页| 亚洲爆乳AAA无码专区| 欧洲精品99毛片免费高清观看 | 黄色网址大全免费| 久久精品免费全国观看国产| 亚洲免费视频一区二区三区| 亚洲一区二区观看播放| 9420免费高清在线视频| 国产亚洲成人在线播放va| 亚洲精品无码你懂的| 我们的2018在线观看免费高清| 亚洲国产精品成人久久久| 在线不卡免费视频| 亚洲一区二区三区高清视频| 久久久国产精品无码免费专区| 亚洲最大激情中文字幕| 伊人久久免费视频| 亚洲国产激情在线一区| 曰批全过程免费视频网址 | 亚洲成av人在片观看| 亚洲欧美日韩自偷自拍| 亚洲AV中文无码乱人伦在线视色| a毛片在线免费观看| 亚洲熟女少妇一区二区| 国产99久久久国产精免费| 亚洲国产综合精品中文字幕 | 自拍偷自拍亚洲精品情侣| 91精品免费高清在线| 亚洲sm另类一区二区三区| 亚洲AV中文无码乱人伦下载| 久久一区二区三区免费| 亚洲国产日韩在线人成下载| 无限动漫网在线观看免费|