随笔分类 - 【2-框架】Spring
1
摘要:Spring Web vs Spring Web MVC Spring Web: Spring Web是Spring框架中用于处理HTTP请求和响应的核心模块,它提供了一个轻量级的Web框架,支持HTTP和HTTP/2协议。 Spring Web不依赖于Spring MVC,它可以独立于Spring
阅读全文
摘要:Spring Web vs Spring Webflux: https://medium.com/@burakkocakeu/spring-web-vs-spring-webflux-9224260c47b5
阅读全文
摘要:JDBC 多数据源实现 参考:https://cloud.tencent.com/developer/article/2186673 Springboot 中使用 JdbcTemplate 实现多数据源比较简单。查看 JdbcTemplate 源码;可以发现 JdbcTemplate 提供了传入 D
阅读全文
摘要:代码位置: spring-context\src\main\java\org\springframework\scheduling\annotation 实现原理: 有对应的BeanPostProcessor实现类 @Async + @EnableAsync 1. 在方法上使用@Async注解,申明
阅读全文
摘要:参考: https://docs.spring.io/spring-framework/reference/integration.html https://github.com/labulakalia/ibm_bak/blob/main/ibm_articles/%E6%B3%A8%E9%87%8
阅读全文
摘要:Bean扫描方式 @ComponentScan 指定1-n个包路径 @Import 指定扫描哪个类如xxConfig,会扫描Config类内部的通过@Bean注解标识方法返回的Bean加载到Spring容器 实现ImportSelector接口:指定1-n待扫描的Config类全限定包名,然后 @I
阅读全文
摘要:如何扩展XML自定义标签:参考spring core.pdf中 10.2 XML Schema Authoring章节(含具体样例) 1. Author an XML schema to describe your custom element(s).2. Code a custom Namespa
阅读全文
摘要:当一个类实现这些接口时,将具有感知有spring容器的能力。意味着容器将通过相同的回调方法向该类提供一些特定信息
阅读全文
摘要:转帖:https://zhuanlan.zhihu.com/p/59327709 TODO
阅读全文
摘要:参考: 阿里开发者-Spring循环依赖那些事(有完整流程图) https://mp.weixin.qq.com/s/cqkZEvmmh7jnNt2K5r_lXg The org.springframework.beans and org.springframework.context packag
阅读全文
摘要:定制bean特性:https://docs.spring.io/spring-framework/reference/core/beans/factory-nature.html Lifecycle Callbacks:The InitializingBean and DisposableBean
阅读全文
摘要:The RestTemplate provides a higher level API over HTTP client libraries 官方:https://docs.spring.io/spring-framework/docs/current/reference/html/integra
阅读全文
摘要:参考:https://www.baeldung.com/tag/spring-annotations/ 按不同维度介绍了注解 >> Spring Conditional Annotations >> AliasFor Annotation in Spring >> Spring @EntitySca
阅读全文
摘要:applicationContext.xml 对比 spring-servlet.xml 参考:https://www.baeldung.com/spring-applicationcontext-vs-spring-servlet-xml 一、过滤器 vs 拦截器 过滤器是Servlet规范的一部
阅读全文
摘要:方式1:通过XML方式指定配置文件路径,用于XML文件中属性 Book.java @Component @Getter @Setter @Data public class Book {private String name; } beans.xml <context:property-placeh
阅读全文
摘要:@EnableXXX这一类注解的作用:就是用来启用某一个功能的配置。启用某一功能,仅需要加上一个注解即可生效,可以使组建之间的相互依赖降低了耦合性。 @EnableWebSecurity @EnableScheduling @EnableAsync @EnableWebMvc @EnableCach
阅读全文
摘要:关键概念澄清:bean validation是规范,通过JSR定义。 Hibernate validation是具体的实现。 参考: https://beanvalidation.org/2.0/ 规范官网,介绍规范演进,JSR1.0->1.1->2.0 定义和实现方(Hibernate valid
阅读全文
摘要:一、基础知识 1. AOP产生背景 AOP(Aspect Orient Programming),作为面向对象编程的一种补充,广泛应用于处理一些具有横切性质的系统级服务,如事务管理、安全检查、缓存、对象池管理等。 AOP 实现的关键就在于 AOP 框架自动创建的 AOP 代理,AOP 代理则可分为静
阅读全文
摘要:Aware系列接口,主要用于辅助Spring bean访问Spring容器; 使用者需实现响应Aware子类接口,并定义相应的成员属性,如ApplicationContext 每个Aware子接口都实现了一个setXX方法,而方法中的形参是接口Aware前面的内容,也就是当前Bean需要感知的内容。
阅读全文
摘要:从类名看功能:生成Bean,实现采用工厂方法设计模式 一、BeanFactory定义 定义的接口用于指定bean属性、特定类型bean和bean相关操作 二、接口实现及继承关系: ListableBeanFactory:表示这些bean是可列表的; HierarchicalBeanFactory:表
阅读全文
1