<table>
<thead>
<tr>
<th th:text="#{msgs.headers.name}">Name</th>
<th th:text="#{msgs.headers.price}">Price</th>
</tr>
</thead>
<tbody>
<tr th:each="prod: ${allProducts}">
<td th:text="${prod.name}">Oranges</td>
<td th:text="${#numbers.formatDecimal(prod.price, 1, 2)}">0.99</td>
</tr>
</tbody>
</table>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> ... </html>
<link rel="stylesheet" type="text/css" media="all"
href="../../css/gtvg.css" rel="external nofollow" th:href="@{/css/gtvg.css}" rel="external nofollow" />
<link rel="stylesheet" type="text/css" media="all" href="/css/gtvg.css" rel="external nofollow" />
title=这是标题 message1=这是消息2 message2=这是消息2 ....
spring.messages.basename=message_chinese
<title th:text="#{title}"></title>
@Controller
public class IndexController {
@RequestMapping(path = {"index", "/"}, method = {RequestMethod.GET})
public String index(Model model) {
model.addAttribute("var1", "value1");
model.addAttribute("src1", "https://www.baidu.com");
Map<String,Object> map=new HashMap<>();
map.put("src1","/a.png");
map.put("src2","/b.png");
model.addAttribute("src", map);
return "index";
}
}
<span th:text="${var1}"></span>
<a th:href="${src1}" rel="external nofollow" >baidu</a>
<img th:src="${src.src1}" />
@Controller
public class IndexController {
@RequestMapping(path = {"index", "/"}, method = {RequestMethod.GET})
public String index(Model model) {
List<String> list=new ArrayList<>();
for(int i=0;i<10;i++){
list.add(String.valueOf(i));
}
model.addAttribute("list", list);
return "index";
}
}
<div th:each="value:${list}" th:text="${value}"></div>
<div th:if="${judge}" >if clause</div>
<div th:unless="${judge}" >unless clause</div>
<div th:switch="${user.role}">
<p th:case="'admin'">User is an administrator</p>
<p th:case="#{roles.manager}">User is a manager</p>
</div>
<!--footer.html--> <div th:fragment="copy">footer</div> <!--index.html--> <div th:include="footer :: copy">index</div>
<div> <div th:fragment="copy">footer</div> </div>
<!--index.html-->
<div th:include="footer :: copy" th:with="param=${value}" >index</div>
<script th:inline="javascript">
/*<![CDATA[*/
...
var username = /*[[${session.user.name}]]*/ 'Sebastian';
...
/*]]>*/
</script>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有