我从书上看到<html:checkbox>标签返回到Form中的值为True或False,于是我在对应得Form中设置了一个boolean变量,但是,好像每次传过来的值都是null类型的:代码如下:
......
<html:checkbox property="checkbox1">Football</html:checkbox>
......对应的Action中execute方法代码处理如下:
......
//s为session对象
if(f.isCheckbox1()==true)
{
    s.removeAttribute("b");
    s.setAttribute("b","Football");
}
......
在JSP页面中我调用s.getAttribute("b")后返回null怎么办,帮帮我!!!!!!!!

解决方案 »

  1.   

    你好像对<html:checkbox>的理解有误
    你应该为之设置value,value的值不限于true\false,也可以是String等值
    如:
    <html:checkbox property="checkbox1" value="ball">Football</html:checkbox>
    则s.getAttribute("checkbox1")为“ball”
      

  2.   

    二楼的试过了吗,默认情况好象值是on,off(String型),不过我也很困惑测试了好多次都不得要领
      

  3.   

    肯定是不局限于boolean估计是代码的问题