【发布时间】:2020-12-19 08:26:28
【问题描述】:
假设我有一个 userCredentials 中的 @ModelAttribute,这是一个 List<String> 对象。
我还有另一个ModelAttribute 类型为Map<String,String> 的roles。
我可以使用 Thymeleaf 在 HTML 中单独访问它们:
${userCredentials.contains('<Hardcoded-value>')}
我想要替换硬编码值并使用的问题,例如:
${userCredentials.contains('roles.client')}
你知道我怎样才能成功地使用一个模型属性作为另一个模型属性的参数。它适用于硬编码值
【问题讨论】:
标签: java spring spring-boot thymeleaf modelattribute