JSP passar valor de checkbox para lógica Java

0 respostas
C
Olá, bom dia. Tenho o código JSP:
<script>   
function gerencia(){   
alert(document.teste.h1.checked)   
}   
</script>   
<input type="text" class="text" size="50" name="reuniao.resp" value="${reuniao.resp}"/><br/>   
  
  
<input type="checkbox" class="text" size="5" name="reuniao.h1" value="${reuniao.h1}"/>  
<script>
function gerencia(){
alert(document.teste.h1.checked)
}
</script>
<input type="text" class="text" size="50" name="reuniao.resp" value="${reuniao.resp}"/><br/>


<input type="checkbox" class="text" size="5" name="reuniao.h1" value="${reuniao.h1}"/>

Aqui aparece o valor true ou false corretamente no alert. Porém na minha lógoca, sempre aparece false para isH1 mas o getResp aparece corretamente. O problema então está em como pegar o valor de um checkbox. Alguma dica?

public void adiciona (Reuniao reuniao) {   
    System.out.println(reuniao.getResp());   
    System.out.println(reuniao.isH1());   
       
this.daoFactory.beginTransaction();   
this.daoFactory.getReuniaoDao().atualiza(reuniao);   
this.daoFactory.commit();   
}
Criado 9 de julho de 2009
Respostas 0
Participantes 1