spring
weixin_45473138
这个作者很懒,什么都没留下…
展开
-
SpringBoot如何实现的自动配置
让你秒懂SpringBoot如何实现的自动配置@SpringBootApplication使用快捷键Ctrl+B 进入方法源码/** * Indicates a {@link Configuration configuration} class that declares one or more * {@link Bean @Bean} methods and also triggers {@link EnableAutoConfiguration * auto-configuration}原创 2020-08-18 11:09:27 · 144 阅读 · 0 评论 -
最为简单的AOP示例
创建Agerntpublic class Agent { public void speak(){ System.out.println("Hello"); }}创建代理public class AgentDecorator implements MethodInterceptor { public Object invoke(MethodInvocation methodInvocation) throws Throwable { Syst原创 2020-07-14 11:04:16 · 138 阅读 · 0 评论 -
Spring初始化bean的三种方式 详细版
Spring初始化bean的方式有三种1 xml配置init-method2 实现InitializingBean 接口3 注解 @postConstruct详细教程开始1 xml配置init-method创建User类public class User { private static final String defaultName="Join"; private String name; private int age=Integer.MIN_VALUE;原创 2020-07-10 11:27:30 · 2396 阅读 · 0 评论 -
Spring xml 配置date类型数据
Spring xml如何自定义转换配置package com.study.pojo;import java.util.Date;/** * person实体类 */public class Person { private String name; private Integer age; private Date date; public Date getDate() { return date; } public voi原创 2020-07-05 22:07:16 · 1448 阅读 · 1 评论 -
SpringBoot简易入门
SpringBoot是一款Spring增强,并不能代替Spring,SpringBoot是一款快速开发基于Spring的脚手架,也可以快速整合第三方框架,SpringBoot可以取代掉繁琐的配置文件,让开发人员关注业务而非配置。Spring的两个核心:1:起步依赖起步依赖本质上是一个Maven项目对象模型(Project Object Model,POM),定义了对其他库的传递依赖,这些东西...原创 2019-11-15 19:02:18 · 116 阅读 · 0 评论