在前面得博客依赖注入与控制反转中演示了应用spring实现ioc,在ApplicationContext.xml中有bean的配置,里面只是bean简单的应用。这篇主要是进一步学习使用bean。

一、定义

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean ></bean>
<bean >
<property name="dao" ref="DaoImpl"></property>
</bean>
</beans>
View Code

相关文章:

  • 2021-05-31
  • 2021-10-22
  • 2021-06-19
  • 2022-12-23
  • 2021-09-03
  • 2022-01-10
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2021-07-01
  • 2021-11-30
  • 2021-04-21
  • 2021-06-20
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案