如下配置中,解释正确有()
A. Line1有错误
B. Line3有错误
C. Line2有错误
D. Line3定义一个前置通知
@Test public void testZhangFei() { Person zhangfei1=beanFactory.getBean(“zhangfei”); Person zhangfei2=beanFactory.getBean(“zhangfei”); System.out.println(zhangfei1 == zhangfei2); } 输出结果是:()
A. true
B. false
C. 运行错误
D. 张飞
的propagation属性表示事务的传播行为,下列哪些是propagation属性的常用值()
A. supports
B. required
C. RequiresNew
D. new
对下面使用Spring依赖注入的代码,下面说法错误的是( )。 ApplicationContext context = new ClassPathXmlApplicationContext("di.xml"); Printer printer = (Printer)context.getBean("printer"); (选择二项)
A. 配置文件di.xml位于classpath目录下
B. 在di.xml中定义了一个id为printer的bean
C. context.getBean()返回的是printer类型的对象,不需要强制转换类型
D. di.xml被修改后,context会自动重新加载