java - How to override PropertySourcesPropertyResolver and add an additional property source to Externalized configuration -
is there way override spring boot's propertysourcespropertyresolver , extend externalize configuration adding additional property source?
what i'm trying add property source in current list, , able override property current mechanism. , extend propertysourcespropertyresolver, when spring mapping properties classes annotated @configurationproperties , requesting key, can check key 2 different prefixes.
for example, if have properties 2 different locations:
properties on location 1: data.user=username
properties on location 2: service.data.user=serviceusername
i want able override value of data.user value of service.data.user (if property exists).
example xml property default value:
<property name="url" value="jdbc:${dbname:defaultdb}"/>
however, there appear few people have been having problems multiple property placeholders, might want watch out for:
- is there way specify default property value in spring xml?
- property not found multiple context:property-placeholder
the other way provide default value data.user
property , let people override necessary.
Comments
Post a Comment