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

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

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

    Java技術專區(qū)--Hilly

    http://blog.duyouyou.com
       :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理

    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住
    主站蜘蛛池模板: 亚洲伊人久久大香线蕉| 亚洲电影在线免费观看| 亚洲一区在线视频| 国产亚洲综合成人91精品| 日本免费人成黄页网观看视频| 全黄大全大色全免费大片| 美女无遮挡免费视频网站 | 美国毛片亚洲社区在线观看| 亚洲黄色在线电影| 亚洲欧洲无码AV电影在线观看| 免费中文字幕在线观看| 好吊妞视频免费视频| 亚洲黄色免费网址| 24小时免费看片| 日韩在线永久免费播放| 黄网站免费在线观看| 中国一级毛片视频免费看| 国产高潮流白浆喷水免费A片 | 白白色免费在线视频| 亚洲av日韩av永久在线观看 | 最近高清中文字幕免费| 3344在线看片免费| 中文字幕无码一区二区免费| 久久成人18免费网站| caoporn成人免费公开| 一级白嫩美女毛片免费| 四虎影视永久在线精品免费| 精品在线观看免费| 杨幂最新免费特级毛片| 一级毛片大全免费播放| 一级**爱片免费视频| 亚洲精品黄色视频在线观看免费资源| 永久免费无码网站在线观看个| 免费一区二区三区在线视频| 免费激情网站国产高清第一页| 青青免费在线视频| jizz免费观看| 久久免费精品视频| 91老湿机福利免费体验| 97无码免费人妻超级碰碰碰碰| 精品免费国产一区二区|