图片.png
1、基于“置顶-SpringBoot-最终整合”进行
2、footer.html页面
<html xmlns:th="http://www.thymeleaf.org">
<!-- 带参数 -->
<footer th:fragment="footer(host)">
<p th:text="| ${host} Year|"></p>
</footer>
</html>
3、在resources下的templates文件夹,创建hello.html
<!DOCTYPE HTML>
<!-- 声明当前文件是Thymeleaf,可以用th开头 -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Thymeleaf</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" media="all" href="../../webapp/static/css/style.css" th:href="@{/static/css/style.css}"/>
<script type="text/javascript" src="../../webapp/static/js/thymeleaf.js" th:src="@{/static/js/thymeleaf.js}"></script>
<script>
testFunction();
</script>
<style>
h2{
text-decoration: underline;
font-size:0.9em;
color:gray;
}
</style>
</head>
<body>
<!-- 包含 footer.html-->
<div class="showing">
<div th:replace="include::footer(2015)" ></div>
</div>
</body>
</html>
4、访问:http://localhost:8080/system/thy1
网友评论