大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
文章目录
前言
研究springboot启动的整个流程。
springboot启动流程图
第一部分 new SpringApplication()
第二部分 工厂对象构建实例
第三部分 SpringApplication.run(启动此应用)
第四部分 SpringApplicationRunListener
SpringApplicationRunListener监听器,监听的就是SpringApplication对象的整个流程。
通过源码和图解对比,我们知道了其运行流程。
清楚知道4种监听器(ApplicationContextInitializer,SpringApplicationRunListener,CommandLineRunner,ApplicationRunner)的运行时机。
第五部分 banner彩蛋
知道banner的源码,我们可以自己改动输出的banner。
通过配置banner,我们切换了banner的输出。
#指定图片banner(显示不好,智能打印黑白)
spring.banner.image.location=panda.png
#指定文本banner
spring.banner.location=mybanner.txt
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/171552.html原文链接:https://javaforall.net