본문 바로가기

Java/Spring Boot

thymeleaf 문법

th:each

java의 forEach와 같은 역할임.

<!-- 템플릿 언어가 렌더링 해줌 -->
<!-- th:each == loop 돌기 -->
<tr th:each="member : ${members}">
    <td th:text="${member.id}"></td>
    <td th:text="${member.name}"></td>
</tr>

 

'Java > Spring Boot' 카테고리의 다른 글

JPA, 스프링 데이터 JPA  (0) 2023.09.18
스프링 장점  (0) 2023.09.18
Spring Bean  (0) 2023.09.16
Test code 작성  (0) 2023.09.15
9.13 스프링 부트 강의 시작  (0) 2023.09.13