I want to inject a Map from a property file into my Bean. What is the best way to configure that?
My props:
Inside my bean I want a Map with the pairs (1, foo) (2, foo).Code:a.b.c.1=foo a.b.c.2=bar
I have found a post on stackoverflow.com which stated:
Only it seems that- implement ApplicationContextAware and set the ApplicationContext as a field in your bean.
- in a @PostConstruct method call context.getBean("${aaa.props}")
- parse the result manually and set it to the desired fieldsdoesn't resolve to my property.Code:context.getBean("${a.b.c.1}");
I also tried to add a property which was:
a.b.c.list=1,2,3
but I can't get those properties from the context.
Is there a way to solve this?


Reply With Quote