springboot30-Thymeleaf循環遍歷list集合



<body>
<!--
    user 當前循環的對象變量名稱(隨意起)
    userStat 當前循環對象狀態的變量(可寫,可不寫),不寫出來也可以用
    ${userList} 當前循環的集合
-->
    <div th:each="user,userStat:${userList}">
        <span th:text="${userStat.index}"></span>
        <span th:text="${userStat.count}"></span>
        <span th:text="${user.getId()}"></span>
        <span th:text="${user.getNick()}"></span>
        <span th:text="${user.getPhone()}"></span>
        <span th:text="${user.getAddress()}"></span>
    </div>
</body>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM