国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

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中定義跳轉的頁面

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數據通過thymeleaf標簽傳到前端界面

把數據放在controller的map中

springBoot加入thymeleaf模板的方式

前端通過標簽取出數據

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模板的方式

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

標簽: Spring
相關文章:
主站蜘蛛池模板: 国产成人精品一区二区不卡 | a黄网站| 午夜日韩视频 | 香蕉97碰碰视频免费 | 中国女警察一级毛片视频 | 欧美视频在线看 | 免费观看一级成人毛片 | 久久精品欧美日韩精品 | 国产成人精品一区二区视频 | 一级毛片成人午夜 | 国产成人精品久久亚洲高清不卡 | 日韩freesex呦交 | 国产在线观看免费一级 | 日本成人在线视频网站 | 国内精品久久久久久 | 免费公开视频人人人人人人人 | 在线视频 一区二区 | 日韩精品久久久免费观看夜色 | 亚洲第一成年网 | 色精品一区二区三区 | 国产精品情侣久久婷婷文字 | 老司机精品影院一区二区三区 | 日本人视频网站一 | 欧美理论在线 | 91精品国产综合久久欧美 | xxxxfreexxxx人妖 | 女人让男人桶的小视频 | 国产成人精品日本亚洲网址 | 亚洲精品国产成人99久久 | 性感美女视频黄.免费网站 性高湖久久久久久久久 | 亚洲巨乳自拍在线视频 | 亚洲九九夜夜 | 国产成人精品视频免费大全 | 好吊色37pao在线观看 | 毛片在线高清免费观看 | 亚洲国产精品成人精品软件 | 久久综合狠狠综合久久综合88 | 日日摸天天摸狠狠摸视频 | 国产欧美一区二区日本加勒比 | 午夜成人在线视频 | 精品亚洲成a人片在线观看 精品亚洲成a人在线播放 |