Context和Container的区别

Context:上下文


Container:容器




Spring的Container包含


    1.bean工厂


    2.Application Context:全权负责对象的创建和组装,自带多个应用上下文,区别仅仅在于如何加载配置配置


        2.1 AnnotationConfigApplicationContext:从一个或多个JavaConfig中加载Spring应用上下文


        2.2 AnnotationConfigWebApplicationContext:加载Spring Web 应用上下文


        2.3 ClassPathXmlApplicationContext:从类路径xml文件中加载上下文


        2.4 FileSystemXmlApplicationContext:从文件系统xml文件中加载上下文


        2.5 XmlWebApplicationContext:从Web应用下的xml文件中加载上下文


        2.6 bean工厂


        2.7 应用上下文:全权负责对象的创建和组装,自带多个应用上下文,区别仅仅在于如何加载配置配置




加载事例


    ApplicationContext context =new FileSystemXmlApplicationContext("c:/xxx.mxl");


{context}