當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
Spring Boot怎么样引入Thymeleaf模板引擎
生活随笔
收集整理的這篇文章主要介紹了
Spring Boot怎么样引入Thymeleaf模板引擎
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、前言:
市場上的模板引擎有很多如下:
JSP、Velocity、Freemarker、Thymeleaf
而SpringBoot推薦的Thymeleaf,其語法更簡單,功能更強大
二、引入thymeleaf
在pom.xml文件下加入以下代碼
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 切換thymeleaf版本 <properties><thymeleaf.version>3.0.9.RELEASE</thymeleaf.version><!-- 布局功能的支持程序 thymeleaf3主程序 layout2以上版本 --><!-- thymeleaf2 layout1--><thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version> </properties>學習內容來自尚硅谷
總結
以上是生活随笔為你收集整理的Spring Boot怎么样引入Thymeleaf模板引擎的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spring Boot怎么样处理静态资源
- 下一篇: Spring Boot—thymelea