【发布时间】:2017-10-23 09:35:21
【问题描述】:
基本上我在属性文件中有配置
data.enabled = true
我为此添加了一个 POJO 类
@Configuration
@PropertySource(value = {"classpath:dataconfig.properties"})
public class DataProperties {
private Boolean enabled;
}
我想使用 thymeleaf 检查 html 标签上的 enabled 属性。
<li th:if="${DataProperties.getEnabled() == true}"><h3>Hello</h3></li>
【问题讨论】:
-
错误是什么?
-
我正在启用属性 null
-
请显示您的控制器代码...或者至少您如何填充模型。
标签: spring-boot thymeleaf