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

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

example:
    
< @global .dialogBegin title ="转栈申请审批" />
< form  id ="declare_form"  method ="post"  action ="${webroot}/delivery/receive!verify.do" >     
    
< input  type ="hidden"  name ="id"  id ="rowId" >     
    
< label > 审核结果: </ label >< br />< input  type ="radio"  id ="yard_confirm_flag"  name ="yardConfirmFlag"  value ="Y" > 同意转栈申请 < input  type ="radio"  id ="yard_confirm_flag"  name ="yardConfirmFlag"  value ="N" > 拒绝转栈申请 < br />
    
< br />< label > 审核意见: </ label >< br />< textarea  name ="yardConfirmComment"  id ="yard_confrim_comment"  style ="width:90%;height:60px;overflow:hidden;" > 同意转栈申请,等待海关审核 </ 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所有值,将其转化成实体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 ;
    }









你可能感兴趣的:(request.getParameterMap()得到form页面所有值)