0

How can i get the reference of the current bean in SpEL in xml configuration. My code is something like this

{ <bean id="circle" class="com.sample.beans.CircleType"> <property name="radius" value="35.0"></property> <property name="perimeter" value="#{2*T(java.lang.Math).PI*circle.radius}" /> <property name="area" value="#{T(java.lang.Math).PI*circle.radius^2}" /> </bean> }

I want to refer property radius while evaluating perimeter and area. How to do this. any catch ? Thanks in advance

1 Answers1

1

You can't do that because the bean is in the process of being instantiated when the expression is evaluated.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179