随笔分类 -  Spring

Spring---依赖注入问题
摘要:配置类中,手动new 对象 @Configuration public class TestConfig { @Bean public TestInterface testInterface(){ return buildTestInterfaceImpl(); } private TestInte 阅读全文

posted @ 2025-02-26 16:54 anpeiyong 阅读(1) 评论(0) 推荐(0) 编辑

Spring---AspectJ与Spring---失效问题
摘要:1、预期的方法被当前类的方法调用 预期方法 被 目标Bean(不是代理Bean)调用 @Service public class AspectJServiceImpl { public void testAspectJ(User s) { String name = this.getClass(). 阅读全文

posted @ 2022-04-20 17:07 anpeiyong 阅读(105) 评论(0) 推荐(0) 编辑

Spring---循环依赖-@Resource
摘要:/** * 【循环依赖 @Resource】 * BeanPostProcessor : org.springframework.context.annotation.CommonAnnotationBeanPostProcessor * org.springframework.beans.fact 阅读全文

posted @ 2022-03-23 16:05 anpeiyong 阅读(625) 评论(0) 推荐(0) 编辑

Spring---循环依赖-@Autowired
摘要:/** * 【循环依赖 @Autowired】 * * BeanPostProcessor : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor * * org.springframew 阅读全文

posted @ 2022-03-23 16:04 anpeiyong 阅读(288) 评论(0) 推荐(0) 编辑

Spring---循环依赖
摘要:总结 什么是循环依赖? A对象中有属性B对象,B对象中有属性A对象; Spring如何解决循环依赖? 1、将Bean的创建分成 实例化 + 初始化 2个过程; 2、提供了3级缓存维护单例Bean: singletonObjects:保存已经初始化完毕的单例Bean。 earlySingletonOb 阅读全文

posted @ 2022-03-23 15:40 anpeiyong 阅读(39) 评论(0) 推荐(0) 编辑

Spring---AspectJ与Spring
摘要:/** * 【代理对象创建】 * * 实现思路:BeanPostProcessor#postProcessAfterInitialization * * org.springframework.beans.factory.support.AbstractAutowireCapableBeanFact 阅读全文

posted @ 2022-03-22 16:36 anpeiyong 阅读(35) 评论(0) 推荐(0) 编辑

Spring---AOP
摘要:总结 基于代理模式。 Spring AOP支持两种类型的代理机制:JDK动态代理和CGLIB代理。这两种代理机制在不同情况下会被使用,具体取决于目标对象的类型。 1. JDK动态代理 适用情况:当目标对象实现了至少一个接口时,Spring会默认使用JDK动态代理。 实现原理: JDK动态代理是Jav 阅读全文

posted @ 2022-03-22 15:17 anpeiyong 阅读(17) 评论(0) 推荐(0) 编辑

Spring---Bean生命周期
摘要:/** * org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory#doCreateBean * org.springframework.beans.factory.support.AbstractAu 阅读全文

posted @ 2022-03-11 16:32 anpeiyong 阅读(30) 评论(0) 推荐(0) 编辑

Spring-IOC
该文被密码保护。

posted @ 2021-11-30 22:34 anpeiyong 阅读(0) 评论(0) 推荐(0) 编辑

Spring---MongoDB
摘要:1、MongoDB概述 1.1、NoSQL数据库 1.1.1、NoSQL的主要特点: 不使用SQL语言 作为查询条件; 数据存储 也不是固定的表、字段; 1.1.2、NoSQL数据库 主要有 文档存储型(MongoDB)、图形关系存储型(Neo4j)、key-value存储型(Redis); 1.2 阅读全文

posted @ 2019-11-27 20:30 anpeiyong 阅读(140) 评论(0) 推荐(0) 编辑

Spring---Redis
摘要:1、概述 1.1、Redis是一个基于key-value的开源内存数据存储; 1.2、Spring 对 Redis的支持 通过Spring Data Redis来实现; Spring Data JPA 为我们 提供了 连接相关的ConnectionFactory、数据操作相关的RedisTempla 阅读全文

posted @ 2019-11-27 19:56 anpeiyong 阅读(117) 评论(0) 推荐(0) 编辑

Spring----组合注解与元注解
摘要:1、概述 1.1、Spring提供了大量的注解, 尤其是相同的注解用到各个类中,会相当的啰嗦; 1.2、元注解: 可以注解到别的注解上的注解; 组合注解: 被注解注解的注解称为 组合注解; 组合注解 具备 元注解 的功能,Spring的很多注解都可以作为元注解; 1.3、案例 package com 阅读全文

posted @ 2019-11-21 09:01 anpeiyong 阅读(590) 评论(0) 推荐(0) 编辑

Spring---条件注解@Conditional
摘要:1、概述 1.1、Spring4 提供了一个更通用的 基于条件的Bean的创建,即使用@Conditional注解; 1.2、案例 package com.an.config; import com.an.conditon.WindowsCondition; import com.an.condit 阅读全文

posted @ 2019-11-20 20:33 anpeiyong 阅读(172) 评论(0) 推荐(0) 编辑

Spring---计划任务
摘要:1、概述 1.1、Spring3.1开始,计划任务在Spring中实现变得异常简单; a,在配置类 注解@EnableScheduling ,开启对计划任务的支持; b,在要执行计划任务的方法上 注解@Scheduled ,声明这是一个计划任务; 1.2、案例 package com.an.conf 阅读全文

posted @ 2019-11-20 20:21 anpeiyong 阅读(117) 评论(0) 推荐(0) 编辑

Spring---Spring Aware
摘要:1、概述 1.1、Spring中的 所有Bean 对Spring容器的存在 是没有意识的(即你可以将容器换成别的容器,这样使用容器与Bean之间的耦合度很低); 但在实际项目中,不可避免的要用到Spring容器本身的功能资源,这时Bean必须意识到Spring容器的存在,才能调用Spring提供的资 阅读全文

posted @ 2019-11-19 17:20 anpeiyong 阅读(118) 评论(0) 推荐(0) 编辑

Spring---SpringMVC
摘要:1、实现原理 2、视图类型 3、视图解析器的类型 4、国际化 4.1 资源文件命名规则: 4.2 实现国际化步骤: a,创建资源文件 b,加载国际化资源文件 阅读全文

posted @ 2019-02-24 17:19 anpeiyong 阅读(81) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示