Announcement Announcement Module
Collapse
No announcement yet.
Populating List values from a file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Haven't tried this approach, but I think you can do this with PropertyEditors.

    Comment

    Working...
    X