I am developing a SpringBoot project and I want to get the bean by its name using applicationContext
. I have tried many solution from web but could not succeed. My Requirement is that I have a controller
ControllerA
and inside the controller I have a method getBean(String className)
. I want to get instance of registered bean. I have hibernate entities and I want to get an instance of the bean by passing the name of class only in getBean
method.
Please help if someone know the solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…