Is there a way to specify a default property value in Spring XML?

后端 未结 7 912
傲寒
傲寒 2020-12-02 07:17

We are using a PropertyPlaceholderConfigurer to use java properties in our Spring configuration (details here)

eg:

         


        
7条回答
  •  借酒劲吻你
    2020-12-02 07:23

    Are you looking for the PropertyOverrideConfigurer documented here

    http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-overrideconfigurer

    The PropertyOverrideConfigurer, another bean factory post-processor, is similar to the PropertyPlaceholderConfigurer, but in contrast to the latter, the original definitions can have default values or no values at all for bean properties. If an overriding Properties file does not have an entry for a certain bean property, the default context definition is used.

提交回复
热议问题