Results 1 to 3 of 3

Thread: applicationcontext as properties file

Threaded View

  1. #1
    Join Date
    Jul 2010
    Posts
    5

    Default applicationcontext as properties file

    Is it possible to use the applicationContext.xml as a .properties file?
    I'd like to have all the configuration in one place and i would like to create some kind of properties bean in the applicationContext. Like so:

    PHP Code:
    <bean id="myProperties" class="Properties">
        <
    property name="name_1" value="value_1"/>
        <
    property name="name_2" value="value_2"/>
    <!-- 
    add your properties here -->
        <
    property name="name_n" value="value_n"/>
    </
    bean

    PropertiesFactoryBean is no good because then i would need an extra config file.

    OK - i just realized all i need is a bean with a property of type map, easy-peasy
    http://www.java2s.com/Code/Java/Spri...jectionMap.htm
    Last edited by Ivanana; Dec 24th, 2010 at 06:51 AM. Reason: found it!

Tags for this Thread

Posting Permissions

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