【发布时间】:2021-07-27 01:38:14
【问题描述】:
在freemarker模板中,我们可以像这样访问spring messages.properties
messages.properties:
...
my.message=foo
...
example.ftl:
<@spring.message 'my.messsage'/>
输出:
foo
有没有办法对 application.properties 和其他活动配置文件中定义的属性做同样的事情?尝试以相同的方式访问产生了以下错误:
No message found under code 'my.prop' for locale 'xx_XX'
编辑: 我已经看到了一些对依赖项进行额外配置的示例,但我正在寻找一种更简单的方法,因为这些建议会严重影响当前代码
【问题讨论】:
标签: spring-boot templates freemarker properties-file