我正在开发一个Spring Boot Web应用程序,该应用程序需要从 homepage.properties 文件中获取一些数值数据。
尽管.properties文件位于同一文件夹内,但是thymeleaf模板视图不会呈现 application.properties 以外的文件的任何属性。
src> main>资源> application.properties(成功获取属性)
src> main>资源> homepage.properties(不获取属性)
这是一个简单的用法:
application.properties
working.hours=650
homepage.properties
test.hours=30
index.html
<h1 class="lan_fun_value mb-1" th:text="${@environment.getProperty('working.hours)}"></h1> //renders 650
<h1 class="lan_fun_value mb-1" th:text="${@environment.getProperty('test.hours)}"></h1> //renders nothing
任何想法可能是什么问题?