<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住
    主站蜘蛛池模板: 天堂亚洲免费视频| 日韩免费无码视频一区二区三区 | 亚洲AV无码一区二区三区在线观看 | 亚洲AV日韩AV永久无码下载| 亚洲欧洲自拍拍偷综合| 亚洲av无码专区在线电影天堂 | 亚洲欧洲无卡二区视頻| 91在线视频免费观看| 手机在线毛片免费播放| 久久亚洲成a人片| 91香蕉国产线在线观看免费| 亚洲精品无码成人片在线观看| 亚洲人成片在线观看| 最近的2019免费中文字幕| 国产亚洲成av人片在线观看| 亚洲精品无码aⅴ中文字幕蜜桃| 日韩精品免费视频| 国产成人综合亚洲AV第一页 | 中文字幕无码精品亚洲资源网久久 | 亚洲AV无码专区在线观看成人| 午夜亚洲福利在线老司机| 久久亚洲最大成人网4438| 一级毛片免费观看不卡的| 亚洲综合在线另类色区奇米| 日韩精品无码免费专区午夜| www.亚洲一区| 国产激情免费视频在线观看| 亚洲国产精品乱码在线观看97| 免费精品一区二区三区第35| 亚洲精品成人片在线观看| 免费国产成人α片| 亚洲熟妇AV一区二区三区浪潮 | 亚洲免费视频一区二区三区| 国产精品免费AV片在线观看| 日韩亚洲产在线观看| 久久激情亚洲精品无码?V| 新最免费影视大全在线播放| 亚洲人成依人成综合网| 日本黄色动图免费在线观看| 亚洲中文无码mv| 亚洲精品乱码久久久久久自慰|