Custom PropertyPlaceholderConfigurer doesn't resolve embedded property values

181 Views Asked by At

I have a Spring 4.3 custom PropertyPlaceholderConfigurer that does extra processing on values read from the properties files before injection:

public class MyPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{ 

    @Override
    protected String convertPropertyValue(final String originalValue) { ... }

    @Override
    protected String resolveSystemProperty(final String key) {
       return convertPropertyValue(super.resolveSystemProperty(key));
    }
}

My problem is that bean fields that are annotated for injection with property values, eg. @Value("${some_property}"), are in fact injected with the raw value read from the property source without my custom processing.

1

There are 1 best solutions below

0
wi2ard On

After some debugging I found that I should have also overiden com.ec.survey.security.SafePasswordPropertyPlaceholderConfigurer#resolvePlaceholder