JSTL继续,深入foreach

JSTL继续,深入foreach,第1张

JSTL继续,深入foreach

没有这样的事情。只需对您 实际 想要显示的内容进行反演即可。所以不要

<c:forEach items="${requestScope.DetailList}" var="list">    <c:if test="${list.someType eq 'aaa' or list.someType eq 'AAA'}">        <<<continue>>>    </c:if>    <p>someType is not aaa or AAA</p></c:forEach>

而是做

<c:forEach items="${requestScope.DetailList}" var="list">    <c:if test="${not (list.someType eq 'aaa' or list.someType eq 'AAA')}">        <p>someType is not aaa or AAA</p>    </c:if></c:forEach>

要么

<c:forEach items="${requestScope.DetailList}" var="list">    <c:if test="${list.someType ne 'aaa' and list.someType ne 'AAA'}">        <p>someType is not aaa or AAA</p>    </c:if></c:forEach>

请注意,我也在您的代码中修复了EL语法错误。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5046818.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存