We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
日期:2020-12-04 问题:spring中,以 Aware结尾的类,都是干什么用的?能举例说明么? 标签:Spring,初级
The text was updated successfully, but these errors were encountered:
Aware就是感知的意思,一般以该单词结尾的类,都实现了Aware接口,该接口就是一个标记,用于表示其子类是可以被回调的。具体回调方法由子类实现,比如ApplicationContextAware
Sorry, something went wrong.
实现了Aware结尾的接口类可以获得相应的spring框架里的相关实例,实际工作中我常用的是ApplicationContextAware获取到spring的上下文,再由此获得相关的bean,这也是获取注入bean的一种方法,在某些无法autowired的情况下使用
这个其实非常常用。可惜的是Spring没有默认提供这种Holder,结果每个项目里都要做这么一个工具类。非常的的不理解
http://xjjdog.cn/interview/16071378538533.html
No branches or pull requests
日期:2020-12-04
问题:spring中,以 Aware结尾的类,都是干什么用的?能举例说明么?
标签:Spring,初级
The text was updated successfully, but these errors were encountered: