0

in our modular application, we have multiple context:property-placeholder definitions, one for each module. Eg.:

applicationContext-module1.xml:

<context:property-placeholder location="classpath*:module1.default.properties,classpath*:module1.${runtime.environment}.properties" ignore-unresolvable="true"/>

applicationContext-module2.xml:

<context:property-placeholder location="classpath*:module2.default.properties,classpath*:module2.${runtime.environment}.properties" ignore-unresolvable="true"/>

etc.

@Value works great, for injecting single values, but I'd like to debug all configuration properties at once. Is it possible to autowire the merged properties read from all files?

milan
  • 21
  • 2
  • what do you mean by "autowire the merged properties read from all files" – Anubhab Mar 08 '13 at 14:28
  • Something like this: @Autowired private Properties allProperties; – milan Mar 12 '13 at 11:40
  • Can you try something like [this](http://stackoverflow.com/questions/534199/how-to-collect-spring-properties-from-multiple-files-for-use-on-a-single-bean) – Anubhab Mar 12 '13 at 11:49
  • Maybe I was not clear enough. I have no problems with reading the properties from multiple locations. What I'd like to achieve is to inject all of the properties (read from different files) into a Map or Properties. – milan Mar 20 '13 at 11:54
  • You can do that in a different java class.is that what you want to achieve? – Anubhab Mar 20 '13 at 11:56
  • Could you please post a sample code? – milan Mar 20 '13 at 14:45

0 Answers0