wood burning stoves 2.0*
The moose likes Spring and the fly likes Accessing property value in spring bean which was setup programmatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Accessing property value in spring bean which was setup programmatically" Watch "Accessing property value in spring bean which was setup programmatically" New topic
Author

Accessing property value in spring bean which was setup programmatically

Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 213
Hi,

I got a strange scenario.

I would like to setup a Properties object programmatically because those values are retrieved from the database. Then these properties values will be then accessed by a spring bean which has been setup in an xml file, e.g. <bean id="ABC" class="org.test.ABC">
<property name="queue" value="${queue_name}"/>
</bean>


where queue_name key is setup programmatically in advanced as its value is retrieved from database.

Please help how to implement it.


Thanks
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1680
    
    7

All sorts of options. Here are a couple:

http://stackoverflow.com/questions/11161490/dynamically-load-spring-bean-properties-from-database-or-java-objects
http://www.codeproject.com/Articles/28893/Loading-Application-Properties-from-a-Database

[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing property value in spring bean which was setup programmatically