html:multibox应用

jsp
      < html:form action = " /updatePermission.do "  method = " post " >
       
< html:multibox property = " basicInfo "  value = " 001 " /> 001 < br />
       
< html:multibox property = " basicInfo "  value = " 002 " /> 002 < br />
       
< html:multibox property = " basicInfo "  value = " 003 " /> 003 < br />
       
< html:submit  />< br />
      
</ html:form >
form
//     private String[] basicInfo = new String[0];  // 表示默认都未选中

    
private  String[] basicInfo  =  { " 001 " , " 002 " }; // 默认选中2项
        
    
public  String[] getBasicInfo() {
        
return  basicInfo;
    }

    
public   void  setBasicInfo(String[] basicInfo) {
        
this .basicInfo  =  basicInfo;
    }
action
 UpdatePermissionForm update  =  (UpdatePermissionForm)form;
        Object obj 
=  update.getBasicInfo();
        String[] biList 
=  (String[])obj;
        
for ( int  i = 0 ;i < biList.length;i ++ ){
            System.out.println(biList[i]);
        }

你可能感兴趣的:(html,jsp)