-
Jun 28th, 2007, 01:42 PM
#1
Populating List values from a file
I'm trying to populate List fields from values stored in text files. I've seen reference on how to load properties (key=value), but not a straight (value) file.
I'm looking at the ListFactoryBean and Resource subclasses, but I'm still not sure where I'm missing the boat. I see the PropertyPlaceholder class, but I dont know if that's what I need to be using.
So, in short, how do I populate myList with the contents of MyFile?
thanks in advance!
class Foo
{
List myList; // assumed to be a list of String
....
getXXX/setXXX
}
<bean id="foo" class="Foo">
<property name="myList" value=???/>
</bean>
MyFile.txt:
A Value
Another Value
-
Jun 29th, 2007, 03:56 AM
#2
Haven't tried this approach, but I think you can do this with PropertyEditors.
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