首页 > 解决方案 > 使用 Spring HealthIndicator 时,Thymeleaf 中的所有 TextNode 都在单词周围显示引号

问题描述

我在 ThymeLeaf 中有以下场景,我将它与 Spring Health Indicator 一起使用。

我有一个来自 Spring 的响应对象,如下所示

        List<String> myItems = getMyListOfBadItems(); 
        Health.Builder status = Health.up();
        return status.withDetail("Questionable Items", myItems).build();

然后在百里香

<tr th:each="unknownItem: ${unknownItems.value}">
   <td th:text="${unknownItem}" />
</tr>

当我这样做时,项目会呈现。但是,它们中的每一个都用引号括起来:示例“item1”、“item2”、“item3”

我需要传递给 org.springframework.boot.actuate.health.Health.Builder 对象的额外参数吗?或者我还需要在 Thymeleaf 中设置什么吗?

在这个关头,报价更令人烦恼

标签: javaspringspring-bootthymeleaf

解决方案


推荐阅读