
spring boot 2.0 高级核心技术
久许
朋友拍了拍我,说我可不是什么幺蛾子
展开
-
Spring Web MVC示例。
1、项目目录结构。其实现在只关注spring-webmvc模块。2、将spring-webmvc模块展开之后,该模块的目录结构如下图。3、src目录完全展开如下图所示。4、app-context.xml文件内容:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spring...翻译 2019-01-11 16:52:29 · 524 阅读 · 0 评论 -
监听spring boot事件
1、spring.factoriescom.imooc.springapplication.listener.BeforeConfigFileApplicationListener2、application.propertiesname = 小马哥3、BeforeConfigFileApplicationListenerpackage com.imooc.springap...翻译 2019-01-09 10:54:28 · 217 阅读 · 0 评论 -
SpringApplicationRunListener(运行监听器)
1、spring.factories# SpringApplicationRunListenerorg.springframework.boot.SpringApplicationRunListener=\com.imooc.springapplication.run.HelloWorldSpringApplicationRunListener2、HelloWorldSpringAp...翻译 2019-01-09 08:40:29 · 1320 阅读 · 0 评论 -
Spring framework中运行监听器事件监听器编程模型
1、引导类package com.imooc.springapplication;import org.springframework.context.ApplicationEvent;import org.springframework.context.annotation.AnnotationConfigApplicationContext;public class Sprin...翻译 2019-01-08 22:55:40 · 174 阅读 · 0 评论 -
加载应用事件监听器
1、spring.factoriesorg.springframework.context.ApplicationListener=\com.imooc.springapplication.listener.AfterHelloWorldApplicationListener,\com.imooc.springapplication.listener.HelloWorldApplicat...翻译 2019-01-08 21:11:34 · 161 阅读 · 0 评论 -
加载应用上下文初始器
1、spring.factories# Initializersorg.springframework.context.ApplicationContextInitializer=\com.imooc.springapplication.context.AfterHelloWorldApplicationContextInitializer,\com.imooc.springappli...翻译 2019-01-08 19:53:14 · 184 阅读 · 3 评论 -
自定义自动装配
1、spring.factories# Auto Configureorg.springframework.boot.autoconfigure.EnableAutoConfiguration=\com.imooc.diveinspringbootzhujie.configuration.HelloWorldAutoConfiguration2、引导类package com...翻译 2019-01-07 22:43:37 · 230 阅读 · 0 评论 -
spring @Enable 模块装配
1、定义注解package com.imooc.diveinspringbootzhujie.anotation;import org.springframework.context.annotation.Import;import java.lang.annotation.*;@Target(ElementType.TYPE)@Retention(RetentionPoli...翻译 2019-01-07 21:57:28 · 233 阅读 · 0 评论 -
基于编程方式实现条件装配
1、定义接口package com.imooc.diveinspringbootzhujie.condition;import org.springframework.context.annotation.Conditional;import java.lang.annotation.*;@Retention(RetentionPolicy.RUNTIME)@...原创 2019-01-07 20:55:29 · 147 阅读 · 0 评论 -
创建Spring应用上下文
1、启动类package com.imooc.springapplication;import org.springframework.boot.WebApplicationType;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.bu...翻译 2019-01-09 13:00:05 · 483 阅读 · 0 评论