PropertyPlaceholderConfigurer to look for DB values and use properties file as fallback

后端 未结 2 516
失恋的感觉
失恋的感觉 2021-01-07 05:57

I\'m wondering if its possible to use the value in DB before properties file in PropertyPlaceholderConfigurer. So what I want to achieve is to load the properties file, and

2条回答
  •  Happy的楠姐
    2021-01-07 06:41

    Since you want to merge properties, you may want to implement InitializingBean on your target bean. Your hook will be the afterPropertiesSet method, where you can go about with your kung-fu.

    BTW, Spring loads and overrides beans definitions in the order the container encounters it.

提交回复
热议问题