jsp页面中,以radio取值

来源:互联网 发布:悟空传 知乎 编辑:程序博客网 时间:2024/06/08 04:21

<td>


 <!-- 
  controller层中:model.addAttribute("pageModel", pageModel);
  jsp页面中:
  <c:forEach items="${pageModel.dataList}" var="user" 
  codeState:数据库中的状态,值为1或2
  name="${status.count }": 输出行号,从1开始。
  -->

  <c:forEach items="${pageModel.dataList}" var="user">


  <c:if test="${user.codeState == 1}"> 
  <input type="radio" name="${status.count }" value="true" 
  checked="checked" />正常 
 
   <input type="radio" name="${status.count }" value="false" />锁定
 </c:if>
 <c:if test="${user.codeState == 2}">
 <input type="radio" name="${status.count }" value="true"/>正常
 <input type="radio" name="${status.count }" value="false" 
 checked="checked"/>锁定
     </c:if>  

   </td>

</c:forEach>

0 0
原创粉丝点击