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

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

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

    Java技術專區--Hilly

    http://blog.duyouyou.com
       :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理

    LookupDispatchAction使用示例

    Posted on 2006-07-20 18:01 duyouyou.com 閱讀(912) 評論(0)  編輯  收藏 所屬分類: web技術
    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住
    主站蜘蛛池模板: 国产亚洲无线码一区二区| 亚洲第一香蕉视频| 成人A片产无码免费视频在线观看| 亚洲韩国精品无码一区二区三区| 95免费观看体验区视频| 亚洲高清毛片一区二区| 亚洲线精品一区二区三区影音先锋 | 无码国产精品一区二区免费vr| 亚洲欧洲精品视频在线观看| 国产gav成人免费播放视频| 一级毛片在播放免费| 亚洲女人18毛片水真多| 亚洲第一黄色网址| 999久久久免费精品国产| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 久久亚洲精品人成综合网| 国产又黄又爽又猛的免费视频播放| 国产线视频精品免费观看视频| 亚洲制服在线观看| 国产中文在线亚洲精品官网| 日韩欧毛片免费视频| 亚洲精品黄色视频在线观看免费资源| 亚洲精品国产肉丝袜久久| 亚洲中文字幕无码一区二区三区| 成人免费视频88| 亚洲免费精彩视频在线观看| 日韩亚洲人成在线综合| 亚洲国产成人精品青青草原| 亚洲综合最新无码专区| 成人免费福利电影| 久久免费国产视频| selaoban在线视频免费精品| 亚洲经典千人经典日产| 久久精品国产亚洲AV麻豆王友容| 亚洲成av人在片观看| 成人免费无码大片A毛片抽搐 | 两个人的视频www免费| 精品无码专区亚洲| 亚洲AV综合色区无码二区爱AV| 亚洲AV日韩精品久久久久| 亚洲国产av一区二区三区|