Spring switch的使用

首先在html开始标签中引入一个属性

1
xmlns:th="http://www.thymeleaf.org"

示例代码

   <div th:switch="${users}">
       <h2 th:case="null">没有数据</h2>
	   <div th:case="*">
   </div>

th:switch相当于java的switch语句

th:case相当java的case语句

case的值写在引号里面

posted @ 2019-06-27 17:51  麦克斯-侯  阅读(154)  评论(0编辑  收藏  举报
百纵科技