返回顶部

利用SpringBeanUtil 来获取 IOC 容器中的bean

有时候在代码中,不希望使用自动注入,而是手动获取Spring容器以及Spring容器中的某个对象 1、首先写一个class实现ApplicationContextAware# import org.springframework.beans.BeansException; import org.sp
posted @ 2024-06-10 17:28  fen斗  阅读(3)  评论(0编辑  收藏  举报