首页 > 其他 > 详细

thymeleaf 字符串判断是否存在

时间:2019-11-18 15:04:35      阅读:1544      评论:0      收藏:0      [点我收藏+]
 <img th:if="${#strings.containsIgnoreCase(files.fileName,‘xls‘)}"
      class="image img-rounded" th:height="200" th:width="200"
      th:src="@{/xls.jpg}">
<img th:if="${#strings.containsIgnoreCase(files.fileName,‘pdf‘)}"
     class="image img-rounded" th:height="200" th:width="200"
     th:src="@{/pdf.jpg}">
<img th:if="${#strings.containsIgnoreCase(files.fileName,‘doc‘)}"
     class="image img-rounded" th:height="200" th:width="200"
     th:src="@{/doc.jpg}">
<img th:if="${!#strings.containsIgnoreCase(files.fileName,‘doc‘)&&!#strings.containsIgnoreCase(files.fileName,‘xls‘)&&!#strings.containsIgnoreCase(files.fileName,‘pdf‘)}"
     class="image img-rounded" th:height="200" th:width="200"
     th:src="@{/kbm/avatar/2019-09-25/9df6747293bd2a44f6d087a99a107f87.png}">

参考:https://blog.csdn.net/qq_33535433/article/details/78876693

thymeleaf 字符串判断是否存在

原文:https://www.cnblogs.com/liouzeshuen/p/11881799.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!