Thymeleaf 기본

2022. 10. 2. 18:36프로젝트/Spring Boot

 

https://chrome.google.com/webstore/category/extensions

 

Chrome 웹 스토어

Chrome에 사용할 유용한 앱, 게임, 확장 프로그램 및 테마를 찾아보세요.

chrome.google.com

 

 

Chrome에 추가 클릭합니다.

 

 

 

확장 프로그램 추가 클릭합니다.

 

 

 

 

Google 번역 클릭합니다.

 

 

 

 

구글 번역이 정상적으로 실행되는 것을 확인할 수 있습니다.

 

 

 

Thymeleaf
th:text 사용 예시
p data-th-text="#{home.welcome}">Welcome to our grocery store!</p>

 

#{...} (메시지표현식) : 다국어 지원기능이 있습니다.

 

표준 표현식 구문
<p th:utext="#{home.welcome}">Welcome to our grocery store!</p>

<p>Today is: <span th:text="${today}">13 february 2011</span></p>

 

 

간단한 표현식

  • 변수 표현식 : ${...}
  • 오브젝트 선택 표현식 : *{...}
  • 메시지 표현식 : #{...}
  • URL 링크 표현식 : @{...}
  • 조각(Fragment) 표현식 : ~{...}

 

Literal(문자)

  • Text(텍스트) : ' '(작은 따옴표)
  • Number(숫자) : 0, 34, 3.0, 12.3
  • Boolean : true, false
  • Null : null

 

Text 연산

  • String 연결 : +
  • Literal 대체 : |The name is ${name}|

 

산술 연산

  • 바이너리 연산 : +, -, *, /, %

 

Boolean 연산

  • 바이너리 연산 : and, or
  • Boolean negaion : !, not

 

비교, 동등 연산

  • 비교 : >, <, >=, <=
  • 동등 연산 : ==, !=

 

 

 

 

더 많은 정보를 원하면 다음 링크에서 정보를 얻을 수 있습니다.

https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html

 

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