java - thymeleaf :block not working any more

标签 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时一切正常。怎么了?

问题出在 <

最佳答案

使用这个:

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

关于java - thymeleaf :block not working any more,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45311059/

相关文章:

Java 有没有办法初始化类型安全的通用数组?

java - CardLayout 使用 JMenu 发送错误信息

java - spring-boot Thymeleaf Multipart 文件上传

java - 解析 HashMap Json .fromJson

java - 错误的 Thread.setDefaultUncaughtExceptionHandler

spring - EL1007E : Property or field **** cannot be found on null

java - 无法在 spring mvc 中获取 thymeleaf 表单数据

自定义 thymeleaf 标签的 XML 命名空间

jsp - 如何使用 Thymeleaf 或 JSP 在 Spring Boot 中启用目录列表

java - 输入多个单词时代码失败