File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 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: 1649
    
    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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Accessing property value in spring bean which was setup programmatically