* th:action    <form id="login" th:action="@{/login}">......</form>    定义后台控制器的路径
* th:each        循环List集合: <tr th:each="user,iterStat : ${list}"> <td th:text="${user.userName}">Onions</td> </tr> iterStat:下标
                      循环Map集合: <div th:each="mapS:${map}"> <div th:text="${mapS}"></div> </div>
                      循环数组:        <div th:each="arrayS:${arrays}"> <div th:text="${arrayS}"></div> </div>
* th:field        
* th:href        定义超链接,类似<a>标签的href 属性。value形式为@{/login}
* th:id            类似html标签中的id属性。    <div class="user" th:id = "(${index})"></div>
* th:if            <span th:if="${Sex} == 1" > <input type="redio" name="se" th:value="男" /> </span> 
                     <span th:if="${Sex} == 2"> <input type="redio" name="se" th:value="女" /> </span>
* th:include
* th:fragment
* th:object
* th:src            外部资源引入    <script th:src="@{/static/js/jquery-2.4.min.js}"></script>
* th:replace
* th:text           <input th:text=${param} />
* th:value        <input th:value=${param} />
 
条件判断可以这样写:<input th:text="(${user.isAdmin}?'管理员':'普通用户')"></input>
 

thymeleaf的配置文件说明 
#spring.thymeleaf.cache = true #启用模板缓存。 
#spring.thymeleaf.check-template = true #在呈现模板之前检查模板是否存在。
#spring.thymeleaf.check-template-location = true #检查模板位置是否存在。
#spring.thymeleaf.content-type = text / html #Content-Type值。 
#spring.thymeleaf.enabled = true #启用MVC Thymeleaf视图分辨率。 
#spring.thymeleaf.encoding = UTF-8 #模板编码。 
#spring.thymeleaf.excluded-view-names = #应该从解决方案中排除的视图名称的逗号分隔列表。 
#spring.thymeleaf.mode = HTML5 #应用于模板的模板模式。另请参见StandardTemplateModeHandlers。 
#spring.thymeleaf.prefix = classpath:/ templates / #在构建URL时预先查看名称的前缀。 
#spring.thymeleaf.suffix = .html #构建URL时附加到查看名称的后缀。 
#spring.thymeleaf.template-resolver-order = #链中模板解析器的顺序。 
#spring.thymeleaf.view-names = #可以解析的视图名称的逗号分隔列表。/ templates / #在构建URL时先查看名称的前缀。 
#spring.thymeleaf.suffix = .html #构建URL时附加到查看名称的后缀。 
#spring.thymeleaf.template-resolver-order = #链中模板解析器的顺序。 
#spring.thymeleaf.view-names = #可以解析的视图名称的逗号分隔列表。/ templates / #在构建URL时先查看名称的前缀。 
#spring.thymeleaf.suffix = .html #构建URL时附加到查看名称的后缀。 
#spring.thymeleaf.template-resolver-order = #链中模板解析器的顺序。 
#spring.thymeleaf.view-names = #可以解析的视图名称的逗号分隔列表。

thymeleaf的使用及配置的更多相关文章

  1. Springboot+Thymeleaf+layui框架的配置与使用

    前言Springboot默认是不支持JSP的,默认使用thymeleaf模板引擎.所以这里介绍一下Springboot使用Thymeleaf的实例以及遇到的问题. 配置与使用1.在applicatio ...

  2. springboot+maven+thymeleaf配置实战demo

    本案例使用thymeleaf,与springboot配置使用.thymeleaf是一种模板语言,可以动态或者静态显示文本内容. 1 .项目结构 2.构建springboot项目 通过idea的new ...

  3. springboot web项目创建及自动配置分析(thymeleaf+flyway)

    @ 目录 源码分析 webjars thymeleaf thymeleaf语法 springmvc 启动配置原理 集成flyway插件 springboot 创建web项目只需要引入对应的web-st ...

  4. SPRING IN ACTION 第4版笔记-第六章RENDERING WEB VIEWS-006- 使用thymeleaf(TemplateResolver、SpringTemplateEngine、ThymeleafViewResolver、th:include、th:object、th:field="*{firstName}")

    一.在Spring中使用thymeleaf的步骤 1.配置 In order to use Thymeleaf with Spring, you’ll need to configure three ...

  5. (二)springboot整合thymeleaf模板

    在我们平时的开发中,用了很久的jsp作view显示层,但是标签库和JSP缺乏良好格式的一个副作用就是它很少能够与其产生的HTML类似.所以,在Web浏览器或HTML编辑器中查看未经渲染的JSP模板是非 ...

  6. SpringBoot入门:新一代Java模板引擎Thymeleaf(实践)

    菜鸟教程:http://www.runoob.com/ http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js http://apps.b ...

  7. spring boot +mybatis(通过properties配置) 集成

    注:日常学习记录贴,下面描述的有误解的话请指出,大家一同学习. 因为我公司现在用的是postgresql数据库,所以我也用postgresql进行测试 一.前言 1.Spring boot 会默认读取 ...

  8. springboot学习二:配置文件配置

    springboot默认读取application*.properties #######spring配置####### spring.profiles.active=dev //引入开发配置文件 a ...

  9. SpringBoot零XML配置的Spring Boot Application

    Spring Boot 提供了一种统一的方式来管理应用的配置,允许开发人员使用属性properties文件.YAML 文件.环境变量和命令行参数来定义优先级不同的配置值.零XML配置的Spring B ...

随机推荐

  1. 关于camera senor的power引脚问题

    <CamDevie> <HardWareInfo> <Sensor> <SensorName name="OV5640" >< ...

  2. WWDC笔记:2013 Session 201 Building User Interfaces for iOS 7

    Text Dynamic Type Specifies fonts semantically Supports user text sizing Optimized for legibility Su ...

  3. JS 通过选择百度地图地址获取经纬度自动填充到文本框中的方法

    首先要注册百度地图API. 1.登录百度地图开放平台http://lbsyun.baidu.com 注册账号,完善信息,点击网站右上角的“API控制台”,点击,创建应用. 应用类型选择:“浏览器端”, ...

  4. 浏览器对MP4视频 帧宽度 高度的兼容性

    传入oss后 或者 本地 拖动到   浏览器 谷歌 都不能播放 Edge 可以播放 但 Edge不支持 本地拖入 播放 搜狗浏览器 同谷歌

  5. 【Silverlight】Bing Maps学习系列(四):使用图钉层(Pushpin layer)及地图图层(MapLayer)(转)

    [Silverlight]Bing Maps学习系列(四):使用图钉层(Pushpin layer)及地图图层(MapLayer) 如果我们需要在Bing Maps中加入一个小图钉标记,该如何实现了? ...

  6. codeforces round 416 div2 补题 CF 811 A B C D E

    A. Vladik and Courtesy 水题略过 #include<cstdio> #include<cstdlib> #include<cmath> usi ...

  7. ubuntu 14.04中: 像ubuntu16.04 一样可以在文件夹内打开此路径下的shell

    sudo apt-get install nautilus-open-terminal 然后重启 ok!

  8. 5. extjs 中buttonAlign什么意思

    转自:https://zhidao.baidu.com/question/1174901985976576339.html指定Panel中按钮的位置.可配置的值有'right', 'left' 和 ' ...

  9. IDEA中项目src目录下无法创建java文件的问题

    出现的问题如下,是因为该目录不是源码目录 解决办法 设置成功

  10. 解方程 2014NOIP提高组 (数学)

    解方程  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond       题目描述 Description 输入描述 Input Description 输入文 ...