Template Engine2 [Template Engine] Thymeleaf 기본 문법 Thymeleaf 문법의 기본적인 특징 : html 태그 안에 th 문법을 추가하는 형태 th:text="${}" th:href="@{}" th:with="${}" th:value="${}" th:action="@{}" th:object="${}" th:field="*{}" th:if="${}", th:unless="${}" th:each="변수 : ${list}" th:switch, th:case * 예제 최대길이 [[${exampleDto.example2}]]자 예제 2024. 9. 14. [Template Engine] 개념 Template Engine : 지정된 템플릿 양식과 데이터가 합쳐져 HTML 문서를 출력하는 소프트웨어로, 크게 서버 템플릿 엔진 과 클라이언트 템플릿 엔진으로 나뉜다. Template Engine의 장점 1. 코드 양 ↓ 2. 재사용성 ↑ 3. 유지보수에 용이 여러 서버 템플릿 엔진의 특징 JSP : Spring Boot에서 권장하지 않음 Velocity : Spring Boot에서 권장하지 않음 Freemarker : 템플릿 엔진으로서 기능이 너무 다양(숙련도 낮은 경우 비즈니스 로직이 추가됨) Thymeleaf : Spring에서 권장, 문법이 어려움 Mustache : 심플하고 서버, 클라이언트 모두 사용 가능 2023. 8. 16. 이전 1 다음