【C015384】在Spring配置文件applicationContext.xml有如下内容:
<bean id="user1" class="accp.User">
……
</bean>
<bean id="group1" class="accp.Group">
……
</bean>
Test.java类中有代码如下:
ApplicationContext ctx
= new ClassPathXmlApplicationContext("applicationContext*.xml");
以下说法错误的是( )。
A.该代码无法成功加载applicationContext.xml文件,只能加载applicationContext*.xml这个文件
B.ClassPathXmlApplicationContext创建时,配置的user1和group1都会被实例化
C.当前配置所示的所有Bean都将只生成一个实例(即单例模式)
D.取得id为user1的bean的代码可以是
User user1 = ctx.getBean("user1");