LoginSignup
0
0

More than 3 years have passed since last update.

SpringBoot中Property和Message的加载顺序问题

Posted at

Spring boot中属性文件加载顺序

  • spring.profiles.include=test1,test2 按照test1,test2的顺序进行加载
  • 无论key定义在哪个文件中,最终生效的总是最后一次加载的key的值

Spring boot 中message文件加载顺序

  • spring.messages.basename=messages1,messages2按照messages1,messages2的顺序进行文件加载
  • 定义在同一个文件中的相同messageId,总是后加载的有效(覆盖)
  • 定义在不同文件中的相同messageId,总是先加载的有效(之前property文件已存在则后续相同key不加载)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0