checkbox 
的值应该是用数组来装的吧?应该是判断数组是否为空吧?要是为空就为FALSE吧?

解决方案 »

  1.   

    你用的是struts吗?
    struts的写法:  <tr>
       <td>&nbsp;</td>
        <td align="left"><input type="checkbox" name="chk" value="问题已处理过">
        问题已处理过</td>

        <td colspan="2"><input type="checkbox" name="chk" value="问题多次出现">
          问题多次出现</td>
      </tr>ActionForm:  private String[] chk;
      
      public String[] getChk(){
         return chk;
      }  public void setChk(String[] strs){
         chk=strs;
      } 数组中只存选中的checkbox的value值。
      

  2.   

    因为没有选中的话,就没有值传进去,所以是null
    你可以这么写  
      private Boolean checkbox1;
          private Boolean checkbox2;
            public void setCheckbox1(Boolean checkbox1){
        this.checkbox1=checkbox1;
        }
        public Boolean getCheckbox1(){
                         if(checkbox1){
                             return true;
                         }
           return false;
        }
       
        public void setCheckbox2(Boolean checkbox2){
        this.checkbox2=checkbox2;
        }
        public Boolean getCheckbox2(){
          if(checkbox2){
                             return true;
                         }
           return false;
        }