반응형
# 타임리프 (Thymeleaf)
- 스프링 부트에서 공식 지원하는 View 템플릿.
- 타임리프는 문서는 html 확장자로 서버 없이도 동작 가능.
- 스프링 부트에서 타임리프를 사용하기 위해 라이브러리 추가 필요. (MVNRepository Spring Boot Starter Thymeleaf)
- https://www.thymeleaf.org/
Thymeleaf
Integrations galore Eclipse, IntelliJ IDEA, Spring, Play, even the up-and-coming Model-View-Controller API for Java EE 8. Write Thymeleaf in your favourite tools, using your favourite web-development framework. Check out our Ecosystem to see more integrati
www.thymeleaf.org
## 타임리프 사용방법
- 타임리프 사용을 위해 문서 최상단에 아래 코드 입력하여 적용.
<html xmlns:th="http://www.thymeleaf.org">
- 서버에서 받아온 데이터를 ${ } 을 이용하여 표기.
문법 | 사용 예 | |
th:text | 문자열 | th:text=" ${data} " |
th:each | 반복문 | th:each="article : ${articleList}" |
th:if | if 조건문 | th:if=${data != null} |
th:href | 이동경로 | th:href=" @{/article/list(id= ${data} )} " |
https://www.thymeleaf.org/ecosystem.html
Ecosystem - Thymeleaf
Developed and maintained by Thymeleaf users outside of the Thymeleaf Project and distributed under their own license and support terms. WUIC Dialect https://wuic.github.io/ WUIC is a Java project that helps developers manage their web statics. JS/CSS minif
www.thymeleaf.org
반응형
'기타' 카테고리의 다른 글
삼항 연산자 (0) | 2022.05.30 |
---|---|
오라클 ORDER BY절 NULL 정렬, ORDER BY 절 CASE (0) | 2022.05.06 |
간단 알고리즘 (0) | 2022.05.02 |
디지털 트윈 (0) | 2022.04.28 |
Collection에서 Map타입과 Set타입의 정의와 둘의 차이점 (0) | 2022.04.28 |