jsp页面数据回显(checkbox+c标签)
已经传递过来了2个列表集合 List<TbCourse> courseList
和 List<TbClazz> clazzList
以及student信息TbStudent tbStudent
下面是TbCourse的属性
private Integer bid;
private String bname;
TbClazz的属性
private Integer cid;
private String cname;
student属性
private Integer id;
private String name;
private String sex;
private Integer bid;
private String bname;
实现课程的回显
<c:forEach items="${courseList }" var="c">
<input type="checkbox" name="course" id="" value="${c.cid }"
<c:forEach items="${tbStudent.courses }" var="cc">
<c:if test="${c.cid==cc.cid }">
checked=true
</c:if>
</c:forEach>
/>${c.cname }
</c:forEach>
关于select下拉选择框的回显可以看这篇文章
https://blog.csdn.net/illusory_germ/article/details/96196325