随笔分类 -  Thymeleaf & Velocity & jetbrick

摘要:5. 内联 [[...]]是内联文本的表示格式,但需要使用th:inline属性(分为text,javascript,none)激活. 5.1 文本内联 <p th:inline="text">Hello, [[${session.user.name}]]!</p> 5.2 脚本内联 <script 阅读全文
posted @ 2017-05-23 14:03 雪山上的蒲公英 阅读(2548) 评论(0) 推荐(0) 编辑
摘要:4. 注释 模板名称:comment.html 4.1 标准 HTML/XML注释 语法:<!-- --> 4.2 解析器级注释块(Parser-level comment blocks) 语法:<!--/* */--> thymeleaf解析时会移除代码 <!--/*--> <div> you c 阅读全文
posted @ 2017-05-23 13:53 雪山上的蒲公英 阅读(8203) 评论(0) 推荐(3) 编辑
摘要:3.7 模板布局 模板名称:layout.html 3.7.1 th:fragment e.g.模板名为footer.html页面body部分如下: <body> <div th:fragment="copy"> &copy; 2011 The Good Thymes Virtual Grocery 阅读全文
posted @ 2017-05-23 13:39 雪山上的蒲公英 阅读(10660) 评论(0) 推荐(2) 编辑
摘要:3.4 属性值的设置 3.4.1 使用th:attr来设置属性的值 <form action="subscribe.html" th:attr="action=@{/subscribe}"> <fieldset> <input type="text" name="email" /> <input t 阅读全文
posted @ 2017-05-23 13:01 雪山上的蒲公英 阅读(33734) 评论(2) 推荐(0) 编辑
摘要:th:*使用原因: for the sake of simplicity and compactness of the code samples(简化代码) the th:*notation is more general and allowed in every Thymeleaf templat 阅读全文
posted @ 2017-05-23 12:11 雪山上的蒲公英 阅读(52582) 评论(0) 推荐(4) 编辑
摘要:2.7 条件表达式 模板名称:condition-express.html <1>a ? b:c (if then:else) <2>a?c (if else) 条件表达式(condition,then和else)的所有三个部分都是表达式,这意味着它们可以是变量(${...},*{...}),消息( 阅读全文
posted @ 2017-05-23 11:09 雪山上的蒲公英 阅读(2173) 评论(0) 推荐(1) 编辑
摘要:2.3 文本操作符 模板名称:text.html 连接符: + 可以是任意字符和表达式等 文本替换符:| 不能表达出条件表达式(官网:只能是变量表达式) e.g. 1.<span th:text="|Welcome to our application, ${user.name}!|"> 2.<sp 阅读全文
posted @ 2017-05-23 11:03 雪山上的蒲公英 阅读(2291) 评论(0) 推荐(0) 编辑
摘要:2.2 文字(literals) 模板名称:text.html 2.2.1 文本(text literals)(放在 单引号 里面,可以是任意字符) <p> Now you are looking at a <span th:text="'working web application'">temp 阅读全文
posted @ 2017-05-23 10:39 雪山上的蒲公英 阅读(2073) 评论(0) 推荐(0) 编辑
摘要:2. 标准表达式(Standard Expression Syntax) 标准表达式包含以下几个方面: 2. 标准表达式(Standard Expression Syntax) 简单表达式: 变量表达式: ${...} 选择变量表达式: *{...} 消息表达式: #{...} 链接网址表达式: @ 阅读全文
posted @ 2017-05-23 10:14 雪山上的蒲公英 阅读(9153) 评论(0) 推荐(2) 编辑
摘要:1. thymeleaf认识 参考官方文档(Project version: 3.0.5.RELEASE) 1.1 介绍 Thymeleaf是面向Web和独立环境的现代服务器端Java模板引擎,能够处理HTML,XML,JavaScript,CSS甚至纯文本。 Thymeleaf的主要目标是提供一个 阅读全文
posted @ 2017-05-23 09:31 雪山上的蒲公英 阅读(9651) 评论(0) 推荐(2) 编辑

/* 返回顶部代码 */