**
springboot模板的使用方法**
@ controllerpublicclasshellocontroller { @ request mapping (“/test”) publicstringtest ) model model.addatribution model 返回' /测试'; 将视图添加到控制器
用html调用
bodyh3test/h3! -不转义--div th:text='${msg}'/div! -转义h1-- div th : u text=' $ { msg } '/div HR h3th : each=' user 3360 $ { users } ' th 3360 text=' $ { user } '/H3
任性的眼睛引入了templates依赖
文件下的test可以直接识别,简单方便
! ----templates---- dependencygroupidorg.thyme leaf/groupidartifactidthymeleaf-spring5/artifact id/dependency
html lang=' en ' xmlns : th=' http://www.w3.org/1999/XHTML '一个不转义
以下是执行的结果