随笔分类 -  spring

摘要:<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-web 阅读全文 »
posted @ 2022-10-28 21:19 wylja 阅读(27) 评论(0) 推荐(0) 编辑
摘要:<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-web 阅读全文 »
posted @ 2022-10-28 21:19 wylja 阅读(30) 评论(0) 推荐(0) 编辑
摘要:注解功能 @Configuration 标识当前类是配置类 @ComponentScan 包扫描注解 扫描注解 @Bean 标识该方法的返回值交给Spring容器管理 @Scope 控制多例和单例 @Lazy 懒加载 @PostConstruct 初始化方法 @PreDestroy 销毁方法 @Co 阅读全文 »
posted @ 2022-10-28 21:18 wylja 阅读(30) 评论(0) 推荐(0) 编辑
摘要:文章目录 前言1 @Configuration和@Bean(给容器中注册组件)1.1 准备工作 创建工程1.2 配置依赖 pom.xml1.3 创建实体类 Person1.4 使用xml配置方式1.4.1 创建一个beans.xml1.4.2 创建测试类 MainTest 1.5 使用注解方式1.5 阅读全文 »
posted @ 2022-10-28 21:18 wylja 阅读(34) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示