摘要: IOC 1.声明bean的注解 @Component 声明bean的基础注解,不属于以下三类时使用此注解 @Controller 标注在控制器 @Service 标注在业务类上 @Repository 标注在数据访问类上,用的比较少 组件扫描:@SpringBootApplication具有包扫描的 阅读全文
posted @ 2024-07-23 20:59 jhhhred 阅读(14) 评论(0) 推荐(0)
摘要: Springboot起步依赖原理 maven的依赖传递原理 Springboot自动配置原理 当spring容器启动后,一些配置类、bean对象就自动存入到了IOC容器中,不需要手动去声明,省去了繁琐的配置操作 Springboot监听机制 Springboot启动流程分析 阅读全文
posted @ 2024-07-23 15:42 jhhhred 阅读(12) 评论(0) 推荐(0)
摘要: Springboot整合junit (1)搭建Springboot工程,引入starter-test依赖 (2)编写测试类 (3)编写测试方法 测试类: 例:UserServiceTest @RunWith(SpringRunner.class) @SpringBootTest(classes = 阅读全文
posted @ 2024-07-23 15:33 jhhhred 阅读(23) 评论(0) 推荐(0)