Reputation: 1151
I have to show the notification if there is some result. Like, if there is a new message, I need to show message. I have three scenarios. I am using
<c:choose>
<c:when test="${formObj.msgNo != 0}">
It is working fine, but the problem is if one condition is met, others are skipped because it is if else block. I want to have rather multiple ifs. Again I can use multiple
<c:choose>
but the main problem with that is I need to show on the page "There is no new notification" if none of the 3 conditions are met. Please guide how to proceed.
Upvotes: 1
Views: 790
Reputation: 50
you can have multiple
<c:if>
and for the case of no notification, you can have something like
<c:choose>
<c:when test="${formObj.msgCount == 0}">
"Here comes your no notification message"
</c:when>
<c:otherwise>
Multiple <c:if></c:if> conditions
</c:otherwise>
</c:choose>
It should handle your use case.
Upvotes: 1