I'm using Spring properties placeholders in my application. One of my properties values contains something Spring interprets as a placeholder, but I don't want it:
@Value("${propertyName}")
private String property;
My property is well defined:
propertyName=Welcome ${name}
Without surprise I get an error :
Could not resolve placeholder 'name' in value "Welcome ${name}"
propertyName is something I want to interpret myself, so I don't want ${name} to be resolved by Spring. Is this possible?
You need to escape dollar ($
) in that case. So that spring doesn't treat this as a property.
propertyName=Welcome #{'$'}{name}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With