타임리프(thymeleaf)를 사용하기 위해서는
1. dependencies에 implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 를 추가해 줘야한다.
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
2. html 파일에 <html xmlns:th="http://www.thymeleaf.org">를 추가해 줘야 한다.
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
</head>
'프로그래밍 > thymeleaf' 카테고리의 다른 글
타임리프(thymeleaf) 링크 URL 표현식 @{} (0) | 2021.09.28 |
---|---|
타임리프(thymeleaf) 선택 변수 표현식 *{} (0) | 2021.09.17 |
타임리프(thymeleaf) map 데이터 출력 (0) | 2021.09.15 |
타임리프(thymeleaf) 텍스트 출력 (0) | 2021.09.12 |
타임리프(thymeleaf) th:each, 변수 표현식: ${...} (0) | 2021.09.04 |