본문 바로가기

Thymeleaf

(3)
[Spring Boot] thymeleaf 사용방법 1. Thymeleaf 란 Thymeleaf는 View Template Engine입니다. 그리고 컨트롤러에서 전달받은 데이터를 이용해 동적인 페이지를 만들 수 있습니다. 태그의 속성으로 thymeleaf 명령어를 사용할 수 있으며 html 파일 내에서 사용이 가능합니다. 2. Thymeleaf 적용 spring boot 2.2.2.RELEASE 버전에서 테스트한 내용입니다. thymeleaf의 default prefix는 src/main/resources/templates이며 suffix는 .html입니다. 1) dependency (pom.xml) ... org.springframework.boot spring-boot-starter-thymeleaf ... 2) Controller import ja..
[Spring Boot] thymeleaf template layout 사용하기 thymeleaf template layout은 thymeleaf를 이용하여 공통 page를 fragment, layout형식으로 조립할 수 있는 template engine입니다. thymeleaf template layout을 사용하는 간단한 예제 프로젝트를 진행해보도록 하겠습니다. 1. Maven dependency 및 프로젝트 구조 1) pom.xml ... 2.2.2.RELEASE ... org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-thymeleaf nz.net.ul..
[Spring Boot] Spring Boot 사용 및 Thymeleaf 연동 방법 1. Spring Boot란 Spring Boot는 Spring 프레임워크를 간편하게 설정하고, 별도에 어려운 설정 없이 바로 개발에 들어갈 수 있도록 만든 프레임 워크입니다. 강력한 기능을 가진 라이브러리들을 Spring Boot 라이브러리에 내장하였고, 내장형 톰캣 등을 탑재하여 단독 실행이 가능해졌습니다. 그리고 프로젝트 생성 시 기존 Spring은 복잡한 설정 파일을 요구했는데, Spring boot는 aplication.yml 설정 파일로 간단하게 설정이 가능하게 되었습니다, 2. 사용하는 라이브러리 ... 2.2.2.RELEASE ... org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-st..