请解释 Spring Bean 的自动装配?


Spring支持IOC,自动装配不用类实例化,直接从bean容器中取。

1、配置在xml中

<bean id="employeeDAO" class="com.guor.EmployeeDAOImpl" autowire="byName" />
2、@Autowired自动装配9

0 0
讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
帮助