Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top