<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无码网站韩国毛片| APP在线免费观看视频| 毛片免费全部播放无码| 亚洲成a人片在线观看日本| 男女一进一出抽搐免费视频| 亚洲人成色7777在线观看不卡| 欧洲乱码伦视频免费国产| 国产三级免费电影| 色吊丝性永久免费看码 | 蜜臀98精品国产免费观看| 亚洲视频免费在线观看| 一级毛片在线免费看| 亚洲欧洲日产专区| 成年性羞羞视频免费观看无限| 亚洲乱理伦片在线观看中字| 又爽又黄无遮挡高清免费视频| 五月天婷婷免费视频| 国产亚洲精品精华液| 中文字幕在线免费观看| 亚洲一区二区三区丝袜| 免费A级毛片无码久久版| 国产日韩精品无码区免费专区国产| 亚洲日韩精品无码专区网址| 日韩在线永久免费播放| 亚洲日韩国产精品乱-久| 全亚洲最新黄色特级网站| 两性色午夜视频免费网| 亚洲最大黄色网址| 精品无码国产污污污免费| 久久精品无码专区免费| 亚洲精品午夜视频| 国产在线观看免费不卡| 美女视频黄的免费视频网页| 亚洲13又紧又嫩又水多| 亚洲第一成人影院| 96免费精品视频在线观看| 亚洲色在线无码国产精品不卡| 亚洲一区精品伊人久久伊人| 6080午夜一级毛片免费看 | 亚洲国产成a人v在线观看| 国产网站在线免费观看|