随笔分类 - Spring
摘要:技术改造,标准的http文件报文,却无法注入,后来发现项目里有这个东西: 转载: https://www.jianshu.com/p/f2817ca8354a 先查个眼慢慢了解
阅读全文
摘要:首先声明一个切面类,注册到容器。 @Aspect @Component public class SpringAspect { @Before("pointcut()") public void before(){ System.out.println("before aspect"); } @Af
阅读全文
摘要:org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration: viewResolver 类路径文件 把类路径下面的/static,/public,/resources和/META_INF/resource文件夹
阅读全文
摘要:1.左边3个接口定义了基本的Ioc容器的2.HierarchicalBeanFactory增加了getParentBeanFactory()具备了双亲Ioc的管理能力3.ConfigurableBeanFactory定义了一些对BeanFactory的配置功能,如setParentBeanFacto
阅读全文
摘要:@Component class A{ @Autowired private B b; } @Component class B{ @Autowired private A a; } @Component class C{ C(D d){ } } @Component class D{ D(C c)
阅读全文
摘要:IOC容器的初始化完成的主要工作是在IOC容器中建立BeanDefinition数据映射。在此过程中并没有看到IOC容器对Bean依赖关系进行注入。 注意到依赖注入的过程是用户第一次向IOC容器索要Bean时触发的。当然也有例外,也就是我们可以在BeanDefinition信息中通过控制lazy-i
阅读全文
摘要:DefaultListableBeanFactory中: DefaultListableBeanFactory实现了BeanDefinitionRegistry,这个接口的实现完成BeanDefinition向容器的注册,这个注册过程不复杂,就是把解析得到的BeanDefinition设置到hash
阅读全文
摘要:@Override public void refresh() throws BeansException, IllegalStateException { synchronized (this.startupShutdownMonitor) { // Prepare this context fo
阅读全文

浙公网安备 33010602011771号