💡 Thymeleaf 에 대해 알아보자! 💡
json
형식이 아닌 html, jsp 등의 페이지를 보내야하는 상황이 발생했다. src/main/webapp/WEB_INF/views/...
) 하고, 별도의 설정 파일을 작성하는 등 약간의 시간이 소요된다. Thymeleaf is a modern server-side Java template engine for both web and standalone environments.
: Thymeleaf는 웹 및 독립형 환경 모두를 위한 최신 서버 측 JAva Template 엔진이다.
Thymeleaf로 작성된 코드들을 보면
html + jstl + el
이라는 생각이 들었다.
Vue.js의
v- ()약
문법 및 표현식이 유사하다.
<!-- thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
src / resources / template/
에 .html
파일 생성@Controller
생성