This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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: 207
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: 1648
    
    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