1.spring容器的基本用法
xml配置
<bean id="myTestBean" class="bean.MyTestBean"/>
调用
BeanFactory bf = new XmlBeanFactory(new ClassPathResource("beanFactoryTest.xml")); MytestBean bean = (MyTestBean) bf.getBean("myTestBean");
时间: 2024-10-01 05:07:26
1.spring容器的基本用法
xml配置
<bean id="myTestBean" class="bean.MyTestBean"/>
调用
BeanFactory bf = new XmlBeanFactory(new ClassPathResource("beanFactoryTest.xml")); MytestBean bean = (MyTestBean) bf.getBean("myTestBean");