Hello,
I work for a bank and we will build many applications using spring 3.x. We need force the use of common folders to all applications and to impose how configurations will be loaded.
- We have a System Property ${rootConfig}for the base dir of all config files.
- Each application will have to put a property file in there rootclasspath named ‘mybank.properties’ containing a property “appName=myApp”. This property will be loaded using the PropertyPlaceholderConfigurer. This work Fine.
To locate the config files all Application will have to concatenate both placeholder: ${rootConfig}/${appName}
Question 1: How can I provide a new Place Holders properties to the ApplicationContext so that programmers will only have to use : ${appConfig} (which will be the concatenation of ${rootConfig}/${appName}. Do I have to create a Custom PropertyPlaceholderConfigurer ? I would like to provide other dynamically created properties that programmers can use as placeholders.
Question 2: To load a property file, we would like to check if the file exist under the ${appConfig} folder, is not, load it from the root classpath. How can I implement this behaviour using the Resources Class (i.e. ResourceLoader, PatternResolver, LoaderAware)? Do I have to build a custom ResourceLoader?
Thank you.


Reply With Quote