控制器
Map<String,Boolean> map= new HashMap<String, Boolean>(); for(Video v :videoList){ map.put(v.getOid()+"", false); }
for (VideoRecord videoRecord : videoRecordList) { map.put(videoRecord.getVideo().getOid()+"", true); }
jsp
<c:forEach items="${videoList}" var="video"> <c:if test="${map[''.concat(video.oid)]}"> <p class="color_66" id="title_${video.oid}" onclick = "getDetail('videodetail_${video.oid}')"> <span><img src="<c:url value='/resources/risk/images/public/pss_video.jpg' />" width="18" height="18">${video.videoName }</span> <span>已观看</span> </p> </c:if> <c:if test="${map[''.concat(video.oid)] eq false}"> <p id="title_${video.oid}" onclick = "getDetail('videodetail_${video.oid}')"> <span><img src="<c:url value='/resources/risk/images/public/pss_video.jpg' />" width="18" height="18">${video.videoName }</span> <span>未观看</span> </p> </c:if> <div class="clear"></div> </c:forEach>