* 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. 2016/1/25 多线程 作业 方法一 继承Thread 方法二 实现Runnable 多线程笔记

    /* * 1,尝试定义一个继承Thread类的类,并覆盖run()方法, * 在run()方法中每隔100毫秒打印一句话.*/ package Stream; //方法一 继承Thread 实现多线程 ...

  2. 获取浏览器弹窗alert、自定义弹窗以及其操作

    web自动化测试第10步:获取浏览器弹窗alert.自定义弹窗以及其操作 - CSDN博客 http://blog.csdn.net/ccggaag/article/details/76573857 ...

  3. 用js采集网页数据并插入数据库最快的方法

    今天教大家一个快速采集网站数据的方法,因为太晚了,直接上例子,这里以采集易车网的产品数据为例. 思路:利用js获取网页数据并生成sql命令,执行sql命令把采集的数据插入数据库. 1.用谷歌浏览器或者 ...

  4. oracle 统计/分析函数

    Oracle从8.1.6开始提供分析函数,分析函数用于计算基于组的某种聚合值,它和聚合函数的不同之处是对于每个组返回多行,而聚合函数对于每个组只返回一行. 语法: Sql代码 <analytic ...

  5. 如何给自己的博客上添加个flash宠物插件

    最近在一些博主的博客上看到一些小宠物的挂件,很有趣,访客到了网站后可以耍耍小宠物,增加网站的趣味性,在功能强大的博客系统上看到有这样的小宠物挂件还是蛮有趣的. 多次差找资料后,终于在http://ww ...

  6. Nginx配置try_files实践一

    参考资料: http://linuxplayer.org/2013/06/nginx-try-files-on-multiple-named-location-or-serverhttp://stac ...

  7. ssm lodop打印图片不显示

    在打印预览的时候图片就是不显示 最终解决方案就是修改过滤器

  8. python中socket编程

    一.网络协议 客户端/服务器架构 1.硬件C/S架构(打印机) 2.软件C/S架构(互联网中处处是C/S架构):B/S架构也是C/S架构的一种,B/S是浏览器/服务器 C/S架构与socket的关系: ...

  9. thinkphp 5 常用的助手函数

    load_trait:快速导入Traits,PHP5.5以上无需调用 /**     * 快速导入Traits PHP5.5以上无需调用     * @param string    $class t ...

  10. 关于ListView的注意点

    解决ListView的一些常见问题: 1.listview在拖动的时候背景图片消失变成黑色背景,等到拖动完毕我们自己的背景图片才显示出来 解决:在XML中加入 android:scrollingCac ...