Can I load nested placeholders from a properties file? I am trying to load a URL dynamically.
For example, if the properties file contains
my.url=http://localhost:8888/service/{nestedProperty}/
Is there a way to load values ββfor {nestedProperty} at runtime? Similar to ResourceBundle behavior. If so, how would I effectively create an instance of String? Still i think
<bean id="myURLString" class="java.lang.String" scope="prototype" lazy-init="true"> <property name="URL" value="${my.url}" /> </bean>
... but I'm not sure what properties to attach. I would like to get a bean using annotations if possible, although I currently have something in the lines
ctx.getBean("myURLString", String.class, new Object[] { nestedProperty} );
I looked at PropertyPlaceholderConfigurer and a few other questions with property files here, but I cannot figure out if this is possible.
It should also be noted that I want to dynamically load this nested property from my code, or at least manipulate it from there (perhaps via @PostConstruct?)
lase
source share