request.getParameterMap()得到form頁面所有值

          example:
              
          <@global.dialogBegin title="轉(zhuǎn)棧申請審批"/>
          <form id="declare_form" method="post" action="${webroot}/delivery/receive!verify.do">    
              
          <input type="hidden" name="id" id="rowId">    
              
          <label>審核結(jié)果:</label><br/><input type="radio" id="yard_confirm_flag" name="yardConfirmFlag" value="Y">同意轉(zhuǎn)棧申請<input type="radio" id="yard_confirm_flag" name="yardConfirmFlag" value="N">拒絕轉(zhuǎn)棧申請<br/>
              
          <br/><label>審核意見:</label><br/><textarea name="yardConfirmComment" id="yard_confrim_comment" style="width:90%;height:60px;overflow:hidden;">同意轉(zhuǎn)棧申請,等待海關(guān)審核</textarea><br/>
          </form>    
          <@global.dialogEnd button="審批"/>

            
          DeliveryMainIndex.java 

          private String yardConfirmComment ;

          public String getYardConfirmComment() {
            
          return yardConfirmComment;
           }


           
          public void setYardConfirmComment(String yardConfirmComment) {
            
          this.yardConfirmComment = yardConfirmComment;
           }


          DeliveryMainIndex obj = (DeliveryMainIndex)this.bindRequestToBean(DeliveryMainIndex.class);

              public Object bindRequestToBean(Class clazz){
                  Object obj 
          = null ;
                  
          try {
                      obj 
          = clazz.newInstance();            
                      BeanUtils.populate(obj, request.getParameterMap());//獲取ftl所有值,將其轉(zhuǎn)化成實體bean
                  }
           catch (InstantiationException e) {
                      
          // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
           catch (IllegalAccessException e) {
                      
          // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
           catch (InvocationTargetException e) {
                      
          // TODO Auto-generated catch block
                      e.printStackTrace();
                  }

                  
          return obj ;
              }









          posted on 2012-05-29 09:53 youngturk 閱讀(1829) 評論(2)  編輯  收藏 所屬分類: Java基礎

          評論

          # re: request.getParameterMap()得到form頁面所有值 2014-11-04 13:53 老鄉(xiāng)們

          和問候問候  回復  更多評論   

          # re: request.getParameterMap()得到form頁面所有值 2015-11-02 14:18 3

          444  回復  更多評論   

          <2012年5月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統(tǒng)計

          公告

          this year :
          1 jQuery
          2 freemarker
          3 框架結(jié)構(gòu)
          4 口語英語

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          EJB學習

          Flex學習

          learn English

          oracle

          spring MVC web service

          SQL

          Struts

          生活保健

          解析文件

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 涞源县| 商南县| 扶绥县| 利川市| 尚志市| 葵青区| 梁河县| 苏尼特左旗| 巫山县| 青河县| 濮阳县| 普兰县| 拜城县| 兴安盟| 墨玉县| 婺源县| 安丘市| 宝坻区| 新巴尔虎右旗| 白城市| 吉木萨尔县| 澎湖县| 申扎县| 新乡县| 云霄县| 洞头县| 吉木萨尔县| 冕宁县| 平谷区| 寿光市| 定兴县| 修武县| 泾川县| 门头沟区| 翁牛特旗| 抚松县| 永年县| 新巴尔虎右旗| 文化| 华亭县| 洛隆县|