查看Spring源码,画出IOC、DI、AOP、MVC的时序图,方便以后查看回忆源码
1、IOC容器初始化
1.1 web ioc容器初始化
1.2 xml ioc容器初始化
以ClassPathXmlApplicationContext的构造方法为入口
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class IoCTest {
public static void main(String[] args) {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
applicationContext.getBean("myUser");
}
}