springboot用法和与各种框架、组件等结合使用,包括springboot的注解分析、路径分析、取得内置对象、项目打包、配置环境属性、读取资源文件、Bean配置、模板渲染、基于yml的多profile配置、基于properties的多profile、添加数据验证、配置错误页、全局异常处理、配置Tomcat运行、配置https访问路径、信息显示、内置对象、显示对象信息、文件上传、使用文件服务器、拦截器、配置druid数据库连接池、整合MyBatis框架、事务控制、Druid监控、整合ActiveMQ、整合RabbitMQ、整合kafka、邮件发送、定时调度、Actuator监控、整合Redis数据库、整合Restfui框架、整合Shiro
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
<footer th:fragment="companyInfo">
|
||||
<p>魔乐科技(www.mldn.cn)</p>
|
||||
<p th:text="${itemid}"/>、<p th:text="${subid}"/>
|
||||
</footer>
|
||||
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr><td>No.</td><td>MID</td><td>姓名</td><td>年龄</td><td>偶数</td><td>奇数</td></tr>
|
||||
<tr th:each="member,memberStat:${allMembers}">
|
||||
<td th:text="${memberStat.index + 1}"/>
|
||||
<td th:text="${member.mid}"/>
|
||||
<td th:text="${member.name}"/>
|
||||
<td th:text="${member.age}"/>
|
||||
<td th:text="${memberStat.even}"/>
|
||||
<td th:text="${memberStat.odd}"/>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="${#maps.containsKey(allMembers,'mldn-7')}"/>
|
||||
<p th:text="${allMembers['mldn-7'].name}"/>
|
||||
<hr/>
|
||||
<table>
|
||||
<tr><td>No.</td><td>KEY</td><td>MID</td><td>姓名</td><td>年龄</td><td>偶数</td><td>奇数</td></tr>
|
||||
<tr th:each="memberEntry,memberStat:${allMembers}">
|
||||
<td th:text="${memberStat.index + 1}"/>
|
||||
<td th:text="${memberEntry.key}"/>
|
||||
<td th:text="${memberEntry.value.mid}"/>
|
||||
<td th:text="${memberEntry.value.name}"/>
|
||||
<td th:text="${memberEntry.value.age}"/>
|
||||
<td th:text="${memberStat.even}"/>
|
||||
<td th:text="${memberStat.odd}"/>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="${#dates.format(mydate,'yyyy-MM-dd')}"/>
|
||||
<p th:text="${#dates.format(mydate,'yyyy-MM-dd HH:mm:ss.SSS')}"/>
|
||||
<hr/>
|
||||
<p th:text="${#strings.replace('www.mldn.cn','.','$')}"/>
|
||||
<p th:text="${#strings.toUpperCase('www.mldn.cn')}"/>
|
||||
<p th:text="${#strings.trim('www.mldn.cn')}"/>
|
||||
<hr/>
|
||||
<p th:text="${#sets.contains(names,'mldn-0')}"/>
|
||||
<p th:text="${#sets.contains(names,'mldn-9')}"/>
|
||||
<p th:text="${#sets.size(names)}"/>
|
||||
<hr/>
|
||||
<p th:text="${#sets.contains(ids,0)}"/>
|
||||
<p th:text="${ids[1]}"/>
|
||||
<p th:text="${names[1]}"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<span th:unless="${member.age gt 18}">
|
||||
你还不满18岁,不能够看电影!
|
||||
</span>
|
||||
<hr/>
|
||||
<span th:switch="${member.mid}">
|
||||
<p th:case="100">mid为101的员工来了</p>
|
||||
<p th:case="99">mid为102的员工来了</p>
|
||||
<p th:case="*">没有匹配成功的数据!</p>
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="'官方网站:' + ${url}"/>
|
||||
<p th:text="'用户名:' + ${mid}"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="${#httpServletRequest.getRemoteAddr()}"/>
|
||||
<p th:text="${#httpServletRequest.getAttribute('requestMessage')}"/>
|
||||
<p th:text="${#httpSession.getId()}"/>
|
||||
<p th:text="${#httpServletRequest.getServletContext().getRealPath('/')}"/>
|
||||
<hr/>
|
||||
<p th:text="'requestMessage = ' + ${requestMessage}"/>
|
||||
<p th:text="'sessionMessage = ' + ${session.sessionMessage}"/>
|
||||
<p th:text="'applicationMessage = ' + ${application.applicationMessage}"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>SpringBoot模版渲染</title>
|
||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||
<link rel="icon" type="image/x-icon" href="/images/mldn.ico"/>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
||||
</head>
|
||||
<body>
|
||||
<a href="aa.html" th:href="@{/show}">访问</a>
|
||||
<hr/>
|
||||
<p th:text="'官方网站:' + ${url}"/>
|
||||
<p th:utext="'官方网站:' + ${url}"/>
|
||||
<hr/>
|
||||
<h2 th:text="#{welcome.url}"/>
|
||||
<h2 th:text="#{welcome.msg('xiaoli')}"/>
|
||||
<hr/>
|
||||
<p th:utext="'官方网站:' + ${url} + '、数学计算:' + (1 + 2)"/>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user