I'm developing a review website, and allowing users to delete their own reviews...
<a href=# style="display:{${review.userId}==${User} hide? 'none' : 'block' }">Delete</a>
so i'm using this code to compare between the id of the user who wrote the review and the logged in user, if he's the one .. he can see the hyperlink, otherwise he won't be able to see it.... but it doesn't work !!.. the logged in user can see all the delete hyperlinks
when i run the code, this is what appears in the browser...
<a href="#" style="display:{7==7 hide? 'none' : 'block' }">Delete</a>
am i doing it right ?
please help me !
Try using tag from the JSTL.
<c:if test="${review.userId == User}">
<a href="#">Delete</a>
</c:if>