当前位置: 代码迷 >> 综合 >> 5.Spring管理对象:配置
  详细解决方案

5.Spring管理对象:配置

热度:30   发布时间:2024-01-17 02:50:16.0
1、spring的依赖包配置
* SPRING_HOME/dist/spring.jar
* SPRING_HOME/lib/log4j/log4j-1.2.14.jar
* SPRING_HOME/lib/jakarta-commons/commons-logging.jar

2、提供spring配置文件applicationContext.xml


3、提供log4j.properties配置文件


4、在UserManager中提供构造函数,让spring将UserDao实现注入(DI)过来


5、让spring管理我们对象的创建和依赖,必须将依赖关系配置到spring的核心配置文件中


6、编写客户端






  相关解决方案