loading properties file in spring

后端 未结 3 958
星月不相逢
星月不相逢 2021-01-14 01:28

One of our team has implemented loading properties this way (see pseudo code below) and advises this approach is right as the client application using this is free to keep t

3条回答
  •  佛祖请我去吃肉
    2021-01-14 02:29

    I'm not sure why a PropertyPlaceholderConfigurator wouldn't have been the correct choice.

    I've almost always handled environment-specific configs via a customized PPC that can either (a) get a -D parameter on startup, and/or (b) use the machine name, to decide which property file to load.

    For me, this is more convenient than bundling the information in via Maven, since I can more easily test arbitrary configurations from whatever machine I'm on (using a -D property).

提交回复
热议问题