일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- MYSQL
- jsp
- vsc
- open in browser
- css
- 여러 종류의 사용자 정의 함수
- github
- ui인터페이스
- resutful api
- @requstbody
- Eclipse
- 게시판
- JavaScript
- IndexedDB
- 데이터 시각화
- 상태값 저장 유지
- 자바스크립트
- chart.js 라이브러리
- vscode
- html
- chart.js
- spring boot
- 초보 개발자
- thymeleaf
- 자바
- 자바빈
- tomcat
- git
- java
- 실시간 상태값 저장
- Today
- Total
수월한 IT
thymeleaf 개요및 설정 본문
thymeleaf는 view template 엔진으로 서버에서 클라이언트에게 응답할 브라우저 화면을 만들어 주는 역할을 한다. thymeleaf는 Natural Template을 기반으로 기존 html 코드와 그 구조를 변경하지 않고 덧붙여 사용하는 방식이라 볼 수 있다.
특징
html 문서 내부에서 사용할 수 있으며 spring boot와 통합하는 작업이 매우 간단함.
관련 사이트 : https://www.thymeleaf.org/index.html
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
VSCode에서 설정하기
1/3 extensions에서 thymeleaf와 thymeleaf-snipper 설치
2/3 pom.xml에서 thymeleaf dependency 추가
3/3 application.properties에 환경설정 추가하기
spring.thymeleaf.check-template-location=true
spring.thymeleaf.suffix=.html
eclipse에서 설정하기
1/2 pom.xml에서 thymeleaf dependency 추가
2/2 application.properties에 환경 설정 추가(위와 동일)
eclipse Marketplace에서 thymeleaf를 검색하여 라이브러리를 설치해도 상관없지만 설치하지 않아도 무난히 사용할 수 있음.
html 파일에서 xmlns 설정
공식 문서에 따르면 일반적으로 html만으로 이루어진 파일에서는 굳이 xmlns를 설정할 필요는 없다. 하지만 html문서가 복합적인 언어로 이루어져 있다면 xmlns를 설정해 놓는 것이 안전하다 볼 수 있다.