Properties handling - Placeholders
We can also use placeholders in properties. A placeholder is a simple reference to another defined property, like a variable.
Let’s see it in action:
The placeholder has the same syntax as the expression in the @Value annotation. It’s SpEL after all.
So, the value of my.url will be http://localhost/remote-call.whatever.
However, don’t overdo it. If it gets too complex, it will be hard to maintain - there is no compile time error.
comments powered by Disqus