久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術(shù)文章
文章詳情頁

springBoot加入thymeleaf模板的方式

瀏覽:5日期:2023-04-17 16:06:08

1.新建springBoot項目

在前面有兩種方式

2.加入thymeleaf模板引擎

SpringBoot推薦使用thymeleaf模板引擎語法簡單,功能更強大要想引入thymeleaf,只需要在pom,xml文件中加入如下依賴就可以了

springBoot加入thymeleaf模板的方式

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>

3.在controller中定義跳轉(zhuǎn)的頁面

springBoot加入thymeleaf模板的方式

會自動去templates文件夾下去找index.html

springBoot加入thymeleaf模板的方式

4.運行,然后訪問項目

輸入http://localhost:8080/testThymeleaf即可訪問index.html

springBoot加入thymeleaf模板的方式

5.在html頁面中加入thymeleaf模板標簽所需的命名空間

springBoot加入thymeleaf模板的方式

<!DOCTYPE html><html lang='en' xmlns:th='http://www.thymeleaf.org'><head> <meta charset='UTF-8'> <title>測試thymeleaf模板</title></head><body>歡迎來到測試thymeleaf界面</body></html>

6.將controller數(shù)據(jù)通過thymeleaf標簽傳到前端界面

把數(shù)據(jù)放在controller的map中

springBoot加入thymeleaf模板的方式

前端通過標簽取出數(shù)據(jù)

springBoot加入thymeleaf模板的方式

顯示效果

springBoot加入thymeleaf模板的方式

6.thymeleaf標簽語法

官方文檔https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.pdfthymeleaf中文https://raledong.gitbooks.io/using-thymeleaf/content/Chapter1/section1.1.html

常用標簽介紹

springBoot加入thymeleaf模板的方式

springBoot加入thymeleaf模板的方式springBoot加入thymeleaf模板的方式

到此這篇關(guān)于springBoot加入thymeleaf模板的方式的文章就介紹到這了,更多相關(guān)springBoot thymeleaf模板內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 97成人精品视频在线观看 | 成人在线免费 | 风间由美一区二区三区在线观看 | 91福利网站在线观看 | 91在线电影 | 国产乱xxxxx97国语对白 | 国产精品久久影院 | 欧美一级免费 | 一区二区三区四区免费看 | 国精产品一区二区三区黑人免费看 | 久久精品欧美一区二区三区不卡 | 欧日韩不卡在线视频 | 成人免费av | 人人干人人干人人干 | 亚洲午夜精品一区二区三区他趣 | 欧美精品在线观看免费 | 中文字幕视频免费观看 | 一级片免费在线视频 | 凹凸日日摸日日碰夜夜 | 久久久久久日产精品 | 亚洲高清视频一区 | 国产富婆一级全黄大片 | 国产激情偷乱视频一区二区三区 | 成年人毛片视频 | 精品在线视频一区 | 女人久久久 | 黄色大片网 | 精品亚洲永久免费精品 | 九九国产精品视频 | 精品午夜久久久 | 日韩高清国产一区在线 | 国产高潮在线观看 | 欧美视频在线播放 | 国产亚洲精品久久久久久久久 | 午夜精品视频在线观看 | 久操成人 | 欧美极品视频 | 欧美日韩亚洲三区 | 北条麻妃一区二区三区在线 | 黄久久久 | 久久精品二区 |