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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 1632
    
    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
 
Similar Threads
using spring expressions
how to organize environment variables?
Getting No suitable driver error using hibernate.
Struts Validation in Spring Context
JPA-hibernate-spring config