摘要: 【爱迪】Spring 之 自动装配 @Autowired, @Resource区别,科普:@Nullable, @Autowired: 使用注解前步骤: 1.导入约束 :在 beans 头部配置 context 约束 2.配置开启注解的支持 : <context:annotation-config/ 阅读全文
posted @ 2020-02-17 21:21 爱迪的懂 阅读(536) 评论(0) 推荐(0)
摘要: 【爱迪】Spring 之 autowire(自动装配) : ByName 和 ByType 我们给People类里 嵌的 Dog 和 Cat 类,在 bean.xml 文件里添加配置(有一个类就要配置一个) , beans.xml 在向 People 类中的这两个 类属性 注入引用 时可自动装配: 阅读全文
posted @ 2020-02-17 16:25 爱迪的懂 阅读(2293) 评论(0) 推荐(2)