Reading properties from a file
hi all
i try to read properties from a file. my configuration looks like that
PHP Code:
<context:property-placeholder location="classpath*:whitelists.properties" ignore-resource-not-found="false" />
then i try to set the value with the @value annotation:
PHP Code:
@Value("${email.exclude}")
private String emailWhitelist;
but i get the following error:
PHP Code:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'email.exclude'
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:173)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
the property is defined in whitelists.properties:
PHP Code:
email.exclude=test@test.ch
so what am i doing wrong?
regards
angela