编写Thymeleaf视图以展示数据
生活随笔
收集整理的這篇文章主要介紹了
编写Thymeleaf视图以展示数据
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
實驗結果
1.編寫控制器
新建一個MVC模式的控制器“HelloWorldMvcController”
2.添加Thymeleaf模板
在template 文件夾下新建文件夾"example",在example下新建hello.html文件
3.添加依賴
在pom.xml中添加如下依賴
4.啟動項目,然后訪問http://localhost:8080/helloworld可以看到網頁中顯示的內容
總結
以上是生活随笔為你收集整理的编写Thymeleaf视图以展示数据的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苏军反坦克炮有多厉害?
- 下一篇: 异常:This application