Java Spring multiple ApplicationContext

前端 未结 6 1744
一生所求
一生所求 2020-12-07 14:51

The definition of the spring ApplicationContext is very ambiguous, I almost finish a whole book of tutorial but still cannot understand what is the Applic

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 15:43

    1. container is a Java object, an instance of one of ApplicationContext implementations like ClassPathXmlApplicationContext.

    2. It is 2 different containers, if Beans.xml has a singleton bean B1, then context1.getBean("B1") and context2.getBean("B1") will return 2 different instances of B1

提交回复
热议问题