Spring mvc 条件语句
当使用Thymeleaf时,我试图有条件地显示某个图像。 这工作正常Spring mvc 条件语句,spring-mvc,thymeleaf,Spring Mvc,Thymeleaf,当使用Thymeleaf时,我试图有条件地显示某个图像。 这工作正常 <img th:if="*{ score < 20 and score > 0}" src="images/Fast-Track-No1.jpg" th:href="@{/images/Fast-Track-No1.jpg}" style = "width: 450px;" alt=""/> <img th:if="*{ score < 20 and score
<img th:if="*{ score < 20 and score > 0}" src="images/Fast-Track-No1.jpg" th:href="@{/images/Fast-Track-No1.jpg}" style = "width: 450px;" alt=""/>
<img th:if="*{ score < 20 and score >= 0}" src="images/Fast-Track-No1.jpg" th:href="@{/images/Fast-Track-No1.jpg}" style = "width: 450px;" alt=""/>
它仍然会失败并抛出错误。根据我的pom.xml文件,我正在使用thymeleaf2.1.2.RELEASE
谢谢,谢谢Jim在Thymeleaf论坛上的发言。。>=或的xml实体不存在
*{score} ge; 0"
<img th:if="*{ score < 20 and score >= 0}" src="images/Fast-Track-No1.jpg" th:href="@{/images/Fast-Track-No1.jpg}" style = "width: 450px;" alt=""/>