• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically initialising bean properties

 
Shasi Mitra
Ranch Hand
Posts: 101
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!