lundi 12 janvier 2015

Comparing two List values in JSTL tag

I'm comparing two different values each from different list using JSTL tag, but I keep getting the error. I tried to change the brackets associated with it, but none worked. I searched for comparing two list values in JSTL, but none helps me.



<c:forEach items="${commentsList}" var="commentsList">
<c:choose>
<c:when test="${ ${commentsList.user.id} == '${blog.user.id}' }">
<li>
<div class="timeline-panel" style="float:right">
<div class="timeline-heading" align="left">
<b>${commentsList.user.firstName}&nbsp;${commentsList.user.lastName}</b>
</div><hr>
<div class="timeline-body" style="float: right;">
<p>${commentsList.comment}</p>
</div>
</div>
</li>
</c:when>
<c:otherwise>
<li class="timeline-inverted">
<div class="timeline-panel">
<b>${commentsList.user.firstName}&nbsp;${commentsList.user.lastName}</b><hr>
<div class="timeline-body">
<p>${commentsList.comment}</p>
</div>
</div>
</li>
</c:otherwise>
</c:choose>
</c:forEach>


Error is



"${ ${commentsList.user.id} == '${blog.user.id}' }" contains invalid expression(s): javax.el.ELException: Error Parsing: ${ ${commentsList.user.id} == '${blog.user.id}' }


I've not compared two list values before, btw I can compare two list values in jstl right?


Aucun commentaire:

Enregistrer un commentaire