Thymeleaf th:阻止不再工作了

时间:2017-07-25 18:29:45

标签: java thymeleaf

我在Thymeleaf中编写了一段代码:

<th:block th:if="${i.mid} > ${yesterday.tableRateModel.rates[e.index].mid}">
                        <i class="glyphicon glyphicon-arrow-up"></i>
                    </th:block>
                    <th:block th:if="${i.mid} == ${yesterday.tableRateModel.rates[e.index].mid}">
                        <i class="glyphicon glyphicon-resize-small"></i>
                    </th:block>
                    <th:block th:if="${i.mid} < ${yesterday.tableRateModel.rates[e.index].mid}">
                        <i class="glyphicon glyphicon-arrow-down"></i>
                    </th:block>

在这种情况下,我得到的错误如下: org.xml.sax.SAXParseException: The value of attribute "th:if" associated with an element type "th:block" must not contain the '<' character.

但是当我评论最后th:block时,一切正常。有什么问题?

问题在于<

1 个答案:

答案 0 :(得分:1)

使用此:

&lt; for <
&gt; for >
&le; for <=
&ge; for >=