- **thymeleaf** : 템플릿 엔진, HTML 페이지와 서버 데이터를 결합 - `th:text="${'안녕' + value + '입니다'}"` - `th:if="${value}"` - `th:each="item:${result}"` -> `th:text="${item.value}"` 1. **Fragment 정의** : `th:fragment`를 사용하여 재사용 가능한 HTML 블록을 정의 ```html <th:block th:fragment="fragmentName">...</th:block> ``` 2. **Fragment 불러오기**: 다른 HTML 템플릿에서 `th:replace` 또는 `th:include`를 사용하여 fragment를 불러오기 ```html <th:block th:replace="filePath :: fragmentName"></th:block> ```
thymeleaf : 템플릿 엔진, HTML 페이지와 서버 데이터를 결합
th:text="${'안녕' + value + '입니다'}"th:if="${value}"th:each="item:${result}"->th:text="${item.value}"Fragment 정의 :
th:fragment를 사용하여 재사용 가능한 HTML 블록을 정의Fragment 불러오기: 다른 HTML 템플릿에서
th:replace또는th:include를 사용하여 fragment를 불러오기