-
Mar 14th, 2010, 11:06 AM
#1
How to use ExposablePropertyPaceholderConfigurer for properties with static refereces
Hi ,
I was trying to use the convinient property Configurer that spring produced for initializing a propery table for my application , Here is the code :
private static ExposablePropertyPaceholderConfigurer _CONFIGURER;
public void setPropertyPlaceholderConfigurer (ExposablePropertyPaceholderConfigurer propertyPlaceholderConfigurer) {
_CONFIGURER = propertyPlaceholderConfigurer;
}
public static String getProperty(String name) {
return _CONFIGURER.getResolvedProperty(name);
}
But I also want to enjoy an eazy way to call it ,using a static reference, but because I configured it with spring I allways have to use with this configurer property , a dependency injection , which is dirty (cause I use those property with allmost 50 classes , so I have to set in 50 beans in the xml this specific property).
There is got to be a way, make a simple reference like Properties.getProperty("something")
instead call a private member setted by injection...
Help pleaseeee
thnx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules