Results 1 to 2 of 2

Thread: Referencing local lists

  1. #1
    Join Date
    Jan 2005
    Posts
    10

    Default Referencing local lists

    Similar to the way that a local bean can be referenced from within the same XML file, i.e.

    <ref local="XYZ"/>

    where bean XYZ has been declared as

    <bean id="XYZ"..../>

    is there a way to reference other local attributes, i.e. lists.

    So if I declare a list,

    <list id="test">.... </list>

    and then want to set this list as a property in my bean

    <bean id="XYZ...>
    <property name="listofNames">
    <ref local..?
    </property>

    is there a way that i can reference the list that I declared outside of the bean definition?

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    You can declare a bean of a list type and reference that as property. Example:

    <bean id="myList" class="java.util.ArrayList">
    <constructor-arg index="0">
    <list>
    ... your values go here ...
    </list>
    </constructor-arg>
    </bean>

    <bean id="myBean" class=...>
    <property name="myListProperty">
    <ref local="myList"/>
    </property>
    </bean>

    Of course you may use Set, Map etc. as well.

    Regards,
    Andreas

Similar Threads

  1. Combining multiple lists into one
    By kbaum in forum Container
    Replies: 2
    Last Post: Oct 23rd, 2005, 06:29 PM
  2. referencing local MBeanServer on Weblogic 8.1
    By kbaum in forum Management
    Replies: 3
    Last Post: Oct 19th, 2005, 09:43 AM
  3. Populating drop-down lists
    By trondgzi in forum Web
    Replies: 5
    Last Post: Feb 3rd, 2005, 05:28 AM
  4. 3rd party integration for Glazed Lists
    By swankjesse in forum Swing
    Replies: 12
    Last Post: Nov 25th, 2004, 01:44 PM
  5. Replies: 6
    Last Post: Nov 16th, 2004, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •