In spring when to use below code? what will be the effect if include below line?
getAutowireCapableBeanFactory().autowireBean(someBean)
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally speaking, the answer is “never”. This is an internal Spring function, and while you can use it yourself, you very probably shouldn’t.
You can use it to autowire dependencies into an object that you create yourself, but that’s a very specialised use case that you don’t need 99.99% of the time.