<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 閱讀(930) 評論(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住
    主站蜘蛛池模板: 最近免费中文字幕大全高清大全1| 免费一级毛片一级毛片aa| 亚洲黄黄黄网站在线观看| 亚洲av无码一区二区三区观看| 日本一区二区三区在线视频观看免费 | 一级毛片成人免费看免费不卡| 亚洲男人天堂2020| 亚洲精品无码久久久久牙蜜区| 麻花传媒剧在线mv免费观看 | 亚洲av午夜福利精品一区| 91在线免费视频| 亚洲av日韩av无码| 亚洲成年人免费网站| 亚洲一级大黄大色毛片| 大学生美女毛片免费视频| 国产亚洲精品第一综合| 国产亚洲成人在线播放va| 国产精品免费看久久久| 亚洲欧洲日韩国产| 性做久久久久免费观看| 无码 免费 国产在线观看91| 亚洲色爱图小说专区| 久久午夜伦鲁片免费无码| 亚洲精品伊人久久久久| 国产又黄又爽又猛的免费视频播放| 麻豆91免费视频| 亚洲av福利无码无一区二区| 无码国产精品一区二区免费| 激情婷婷成人亚洲综合| 中文亚洲AV片不卡在线观看| 最近免费中文字幕高清大全 | 亚洲AV日韩AV一区二区三曲| 亚洲第一永久AV网站久久精品男人的天堂AV| 成人国产精品免费视频| 亚洲手机中文字幕| 亚洲高清最新av网站| 99热在线观看免费| 美女羞羞免费视频网站| 亚洲国产美国国产综合一区二区| 最近免费中文字幕大全| 韩国免费a级作爱片无码|