aspose file tools*
The moose likes Other Application Frameworks and the fly likes Dynamically initialising bean properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Dynamically initialising bean properties" Watch "Dynamically initialising bean properties" New topic
Author

Dynamically initialising bean properties

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

I want to initialise my bean properties from some other bean. Like

<bean id="testVO" class="com.TestVO" scope= "request">
<property name = "name" >
<value>#{bean2.name}</value>
</property>
</bean>

Is it possible to get name from bean2 and put in testVO dynamically?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

No because the value of the variable you have is not set till runtime. Whereas the configuration is during development time, meaning you can't set a value in the configuration to a value that isn't set till runtime.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically initialising bean properties