数据渲染

1.javabean对象

<div>
    <div th:text="${user.getName()}"></div>
</div>

2.List集合

<div th:each="item:${articles}">
    <div th:text="${item.getTitle()}"></div>
    <div th:text="${item.getContent()}"></div>
</div>

3.Map

 <div>
    <div th:text="${map.get('place')}"></div>
    <div th:text="${map['place']}"></div>
    <div th:each="item:${map}">
        <div th:text="${item.key}"></div>
        <div th:text="${item.value}"></td>
    </div>
</div>
posted @ 2023-01-30 15:55  lwx_R  阅读(9)  评论(0编辑  收藏  举报