【发布时间】:2015-07-18 08:32:49
【问题描述】:
我正在使用带有百里香叶的弹簧靴。这是我的项目结构:
这是我的应用开始类:
@EnableAutoConfiguration
@Configuration
@ComponentScan
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class);
}
}
我的 home.leaf.html 上有这个:<p th:text = "#{username}"></p>
但是当我运行这个应用程序时,我得到的是:??username_en_US??
我尝试了各种方法来解决此配置问题。请问,谁能帮忙?
【问题讨论】:
-
看来你需要配置你的消息源(设置spring会查找messages.properties的目录)
-
将
message.properties重命名为messages.properties。 -
感谢@PedroAffonso 和 M. Deinum。首先我重命名为messages.properties,然后将其移到资源目录下,& Eureka!成功了!
标签: java spring spring-boot thymeleaf