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