摘要:
1.创建 UserService,UserService 内部在调用 UserDao的save() 方法 package ioc1.it.dao; public class userDaoImpl implements userDao { public userDaoImpl() { System. 阅读全文
posted @ 2020-05-05 23:09
每月工资一万八
阅读(113)
评论(0)
推荐(0)
摘要:
无参构造方法实例化 工厂静态方法实例化 1.创建一个静态工厂 返回值是userDao对象 package factory; import ioc1.it.dao.userDao; import ioc1.it.dao.userDaoImpl; public class staticFactory { 阅读全文
posted @ 2020-05-05 23:03
每月工资一万八
阅读(128)
评论(0)
推荐(0)
摘要:
init-method:指定类中的初始化方法名称 destroy-method:指定类中销毁方法名称 <bean id="userDao" class="ioc1.it.dao.userDaoImpl" init-method="init" destroy-method="destroy"></be 阅读全文
posted @ 2020-05-05 22:49
每月工资一万八
阅读(95)
评论(0)
推荐(0)
摘要:
1)当scope的取值为singleton时 Bean的实例化个数:1个 Bean的实例化时机:当Spring核心文件被加载时,实例化配置的Bean实例 Bean的生命周期: 对象创建:当应用加载,创建容器时,对象就被创建了 对象运行:只要容器在,对象一直活着 销毁:当应用卸载,销毁容器时,对象就被 阅读全文
posted @ 2020-05-05 22:41
每月工资一万八
阅读(151)
评论(0)
推荐(0)
摘要:
1.导入 Spring 开发的基本包坐标 <dependencies> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <groupId>org.springfra 阅读全文
posted @ 2020-05-05 22:37
每月工资一万八
阅读(258)
评论(0)
推荐(0)

浙公网安备 33010602011771号