随笔分类 -  Spring

摘要:原理使用spring aop进行织入 1.创建3个类 3 import java.lang.annotation.*; 4 /** 5 * 多数据源 6 * @author mengxu 7 * @version 2022-12-1 8 */ 9 @Target({ElementType.TYPE, 阅读全文
posted @ 2022-12-06 15:32 aniymx 阅读(126) 评论(0) 推荐(0)
摘要:spring第二天反思与总结 作用在类上面使用component,但是根据分层思想, web层使用@controller service使用@service dao层使用repository 以上注解作用跟标签作用相同,都是用来在ioc中创建对象 依赖注入注解方式: autowired自动注入,如果ioc容器中有单一匹配的对象,就可以注入成功 如果ioc容器中有多个对象,需要使用Quali... 阅读全文
posted @ 2018-11-16 20:28 aniymx 阅读(214) 评论(0) 推荐(0)