Html 在thymeleaf中,当if条件满足时,我希望中断循环

Html 在thymeleaf中,当if条件满足时,我希望中断循环,html,thymeleaf,Html,Thymeleaf,我的html文件中有这段代码,我想在第一次满足if条件时中断thymeleaf循环 我的回路在这里 <span th:if="${not #lists.isEmpty(${cart.orderItems})}" th:each="item : ${cart.orderItems}" th:if="${item.parentOrderItem}==null and ${item.category} != null" id="ie-print-help" cla

我的html文件中有这段代码,我想在第一次满足if条件时中断thymeleaf循环

我的回路在这里

<span  th:if="${not #lists.isEmpty(${cart.orderItems})}" th:each="item : ${cart.orderItems}" 
            th:if="${item.parentOrderItem}==null and ${item.category} != null"   id="ie-print-help" class="ie-print-help"><span class="glyphicon glyphicon-info-sign"></span></span>

您在不需要时使用了太多的
${}

    <span th:if="${not #lists.isEmpty(cart.orderItems)}" th:each="item : ${cart.orderItems}">
        <span th:if="${item.parentOrderItem ==null and item.category != null}"   id="ie-print-help" class="ie-print-help">
           <span class="glyphicon glyphicon-info-sign"></span>
         </span>
     </span>

您的代码只是一个格式化版本。它是如何打破循环的?