Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically initialising bean properties  RSS feed

 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!