<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住
    主站蜘蛛池模板: 亚洲黄色在线播放| 亚洲精华国产精华精华液| 欧洲美女大片免费播放器视频| 久久久久av无码免费网| 91久久亚洲国产成人精品性色 | 亚洲AV无码乱码在线观看| 亚洲综合无码一区二区痴汉 | 国产精品亚洲а∨无码播放不卡| 成人黄页网站免费观看大全| 亚洲色精品三区二区一区| 成人毛片免费播放| 国产AV日韩A∨亚洲AV电影| 亚洲福利视频一区二区| 日日狠狠久久偷偷色综合免费| 亚洲男人天堂2020| 亚洲欧洲免费视频| 亚洲精品中文字幕无乱码麻豆| 成年女人毛片免费观看97| 免费国产黄网站在线看| 亚洲中文久久精品无码| 亚洲精品免费视频| 日本亚洲免费无线码| 日本免费v片一二三区| 午夜成人无码福利免费视频| 久久久亚洲精品国产| 18禁美女黄网站色大片免费观看| 亚洲伊人久久精品| 免费人成网站在线播放| 水蜜桃视频在线观看免费播放高清| 亚洲av无码乱码国产精品fc2| 久久久久久99av无码免费网站| 老子影院午夜伦不卡亚洲| 亚洲线精品一区二区三区影音先锋| 日韩精品内射视频免费观看| 亚洲乱码国产乱码精华| 久久精品亚洲福利| 在线观看H网址免费入口| 国产精品亚洲专一区二区三区| 国产亚洲色婷婷久久99精品| 国产1024精品视频专区免费| caoporm碰最新免费公开视频|