spring - 如何在 Thymeleaf 上设置多个条件

标签 spring thymeleaf

我想在像这样的 Thymeleaf 模板上设置一些条件,
但它不起作用。

<li th:if="${entry.description != null && entry.owner == true}" th:each="entry : ${entryList}" class="group">

如何使此代码正确工作?

最佳答案

代替

"${entry.description != null && entry.owner == true}"
"${entry.description != null and entry.owner == true}"
作为引用,您可以查看此线程:
http://forum.thymeleaf.org/How-to-have-multiple-condition-in-an-th-if-tag-td4025931.html
让我知道你怎样去

关于spring - 如何在 Thymeleaf 上设置多个条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26174112/

相关文章:

java - 为什么 :text doesn't want to display in the main. html 模板显示在其他页面中?

java - 如何在 Spring Boot 应用程序中设置 GOOGLE_APPLICATION_CREDENTIALS

java - 如何缩小 Thymeleaf 生成的 HTML

java - 如何使用 Spring Boot、JPA 和 Thymeleaf 设置搜索栏

mysql - 使用 Spring Boot JPA 在数据库中插入多行

javascript - 在 OpenLayers 和 Thymeleaf 中使用 Javascript 变量

java - 静态文件找不到 Spring MVC + Thymeleaf

java - 在 Tomcat 中集成 Wink 和 Spring

java - Spring MVC 3 - 使用 404 响应请求?

java - Spring AOP : How to pass argument from called method to advice method?