본문 바로가기
Spring boot Web project/Web Technology

[Thymeleaf] 하나부터 열까지 ( Part 1 )

by 데구르르르 2020. 2. 17.
728x90

+ 참고 : Thymeleaf Document
            https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#standard-expression-syntax

 

Tutorial: Using Thymeleaf

1 Introducing Thymeleaf 1.1 What is Thymeleaf? Thymeleaf is a modern server-side Java template engine for both web and standalone environments, capable of processing HTML, XML, JavaScript, CSS and even plain text. The main goal of Thymeleaf is to provide a

www.thymeleaf.org

 

Thymeleaf 작성법 - string.replace, string.split, string.arraySplit

th:속성명 = "서버에서 전달 받은 값 or 조건식"

Attribute Description
th:text 텍스트 내용 출력
<p th:text = "${project.title}"></p>
th:utext html 태그가 포함된 내용 출력
<p th:text = "${messages}"></p>
th:value element의 value , option의 value , checkbox의 value , input 의 value
<input type="text" th:value="${project.title}"> 
th:href <a th:href="@{go_mypage}"></a>
<a th:href="@{ go_mypage?id=${user.id} }"></a>
<a th:href="@{| go_mypage?id=${user.id}&passwd=${user.passwd} |}"></a>
th:block div 와 같은 기능 으로 문단을 묶음
th:include 다른 파일의 내용을 불러오거나 fragment 로 지정된 영역을 불러옴
<th:block th:include="./header.html"></th:block>
th:fragment 레이아웃을 만드는 기능으로 th:include 를 사용해서 불러옴
<div th:fragment = "article" ></div>
th:selected  
th:data  
th:onfocus  

th:switch


th:case

 
th:if  
th:unless  
th:each  
th:with  
728x90

댓글