Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotation | Ahir's Blog #4

Open
Mintneko opened this issue Jan 12, 2022 · 0 comments
Open

annotation | Ahir's Blog #4

Mintneko opened this issue Jan 12, 2022 · 0 comments

Comments

@Mintneko
Copy link
Owner

https://mintneko.github.io/2022/01/12/annotation/#Component

@Autowired 注解AutowiredAnnotationBeanPostProcessor在处理依赖注入时,从bean工厂中去获取,首先是根据字段的类型去找符合条件的bean,若得到的bean有多个,则找出有@primary注解修饰的bean,若都没有,则退化成@resource注解的功能,即根据字段名去寻找bean,若都没有,则会抛出找到多个bean的异常。可以定位到org.spring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant