我从书上看到<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怎么办,帮帮我!!!!!!!!
......
<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怎么办,帮帮我!!!!!!!!
你应该为之设置value,value的值不限于true\false,也可以是String等值
如:
<html:checkbox property="checkbox1" value="ball">Football</html:checkbox>
则s.getAttribute("checkbox1")为“ball”