日期:2014-05-17  浏览次数:20812 次

关于jsp页面单选按钮的问题
<td>
<input type="radio" name="sex" value="0" <c:if test="${requestScope.user.sex==0}" >checked='checked'</c:if> />男
<input type="radio" name="sex" value="1" <c:if test="${requestScope.user.sex==1}" >checked='checked'</c:if>/>女
</td>
在数据库里取出了值。
然后写的JSTL表达式,
为什么这样不能判断呢

------解决方案--------------------
直接user.sex
实现user对象存入作用域中
以后楼主遇见以上问的话可以直接在页面输出
Java code
out.printuser.sex