我想根据用户信誉显示图片。我事先测试了图像,所以我知道URL是正确的。但是我的switch case语法有问题:
<th:block th:switch="${reputation}">
<div th:case="${reputation} < 0">
<img th:src="@{/css/img/troll.png}"/>
</div>
<div th:case="0">
<img th:src="@{/css/img/smeagol.jpg}"/>
</div>
<div th:case="${reputation} > 0 && ${reputation} < 5">
<img th:src="@{/css/img/samwise.png}"/>
</div>
<div th:case="${reputation} ≥ 5 && ${reputation} ≤ 15">
<img th:src="@{/css/img/frodo.png}"/>
</div>
<div th:case="${reputation} > 15">
<img th:src="@{/css/img/gandalf.jpg}"/>
</div>
</th:block>
这给了我以下错误:
org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 61; The entity name must immediately follow the '&' in the entity reference.
它可能会给我这个错误,因为我试图在这种情况下使用两个范围?
我已经浏览过互联网,但我无法找到这样一个交换机实现的例子。