Injecting static variables

Is it possible to inject static variables of one class into another using spring config ?
FranklinRaj22Asked:
Who is Participating?
 
Mahesh BhutkarConnect With a Mentor Commented:
You can use org.springframework.beans.factory.config.MethodInvokingFactoryBean.

Add setter method to inject the value.

Check this example :- http://www.felfelworld.com/2012/07/08/how-make-spring-initialize-static-variable/
0
 
Smart_KidCommented:
Can you please make it clear on what you meant by spring config.?
0
 
anwarulCommented:
question not clear
0
 
FranklinRaj22Author Commented:
Sorry my mistake , I wanted to inject static variables from class A into Class B and wanted to do it via spring config file rather than doing it in the Class B code .

I used the below and it worked well .
util:constant static-field
0
All Courses

From novice to tech pro — start learning today.