The API indicates that the PropertyPlaceholderConfigurer works with lists. Is there an example of this?
I'm already using the PropertyPlaceholderConfigurer to pull in database connection info. Works great, when need to do something like this in my bean definition:
But what I now need to do is take a set of name/value pairs from a property file and insert those name/value pairs into a HashMap in my storage object.Code:<property name="user"><value>${jdbc.user}</value></property> <property name="url"><value>${jdbc.url}</value></property>
So my properties file will look something like:
And my object that contains that looks like this:Code:java.sql.type.1="text.vm" java.sql.type.2= "textarea.vm" java.sql.type.3="select-list.vm"
The data from the property file needs to go into the HashMap as key/value pairs.Code:public class Mapper { // instance variables private HashMap Map; // accessors go here ... }
I can structure the accessor methods to this storage object any way I want (with setters/getters, add/puts that expose the underlying HashMap, etc.) but I'm not sure what the syntax for the applicationContext.xml file would be to get a list read out of the property file and into a HashMap fronted by my storage object.
Is that possible?
Thanks!
- Gary


Reply With Quote