We are developing requirements , use thymeleaf When traversing a collection , Sometimes we need to do collection interception , For example, only before getting the collection 6 Data ;
<div class="wap_course_item" th:each="hktj,hktjStat:
${application.courseHktjList}" th:if="${hktjStat.count}<=6"> <a target="_blank"
th:href="'/course/'+${hktj.id}"> <b class="img"> <img class="lazy" th:src=
"'/courseImages/'+${hktj.imageName}" th:alt="${hktj.name}" style="display:
inline;"> </b> <div class="content"> <h5 th:title="${hktj.name}" th:text="
${#strings.abbreviate(hktj.name,20)}"></h5> </div> </a> </div>
We can go through Stat Object's count attribute , use th:if Judge to realize the collection interception function ;

Show only 6 Data ;

Technology
©2019-2020 Toolsou All rights reserved,
html Writing about cherry trees , Writing about cherry trees It's unexpected Python Cherry tree (turtle The gorgeous style of Library ) Browser kernel ( understand )HashMap Explain in detail java Four functional interfaces ( a key , simple )os Simple use of module Some East 14 Pay change 16 salary , Sincerity or routine ?