目录
一.为什么要使用Spring Boot
二.什么是Spring Boot
三.Spring Boot的特性
四.Spring Boot整合Mybatis
一.为什么要使用Spring Boot
Spring虽然是个轻量级的框架,但是当我们业务复杂时,需要加入的组件也会增多,随之我们配置的bean也会增多,那么我们的配置会变的非常的繁杂。
回想一下我们如何构建SpringMVC项目:
创建一个项目结构( maven/gradle)spring的依赖,spring mvc . servlet api的依赖web.xml,DispatcherServlet 启动一个Spring MVC的配置,Dispatcher-servlet.xml创建一个Controller发布一个http请求发布到jsp/servlet容器(Tomcat)
由此可见MVC的配置非常的繁琐,每个项目都要重复很多的模板式的配置。
所以我们可不可以简化项目的配置呢?Spring Boot帮我们解决了这个问题
二.什么是Spring Boot
Spring Boot makes it easy to create stand-alone, production-grade Spring basedApplications that you can "just run".
We take an opinionated view of the Spring platform and third-party libraries so youcan get started with minimum fuss. Most Spring Boot applications need minimalSpring configuration.
Spring Boot使得创建独立的、基于生产级Spring的应用程序变得很容易,你可以“直接运行”。
我们对Spring平台和第三方库有自己的管理,所以您可以尽量避免过于关注版本控制。 大多数Spring Boot应用程序只需要很少的Spring配置。
Spring Boot makes it easy to create stand-alone, production-grade Spring basedApplications that you can "just run".
We take an opinionated view of the Spring platform and third-party libraries so youcan get started with minimum fuss. Most Spring Boot applications need minimalSpring configuration.
Spring Boot使得创建独立的、基于生产级Spring的应用程序变得很容易,你可以“直接运行”。
我们对Spring平台和第三方库有自己的管理,所以您可以尽量避免过于关注版本控制。 大多数Spring Boot应用程序只需要很少的Spring配置。
Spring Boot 是约定优于配置理念下的产物。
只要依赖了spring-boot-starter-web的jar,就会内置一个tomcat容器(可替换)。这就相当于一种约定。默认提供application.properties配置文件
三.Spring Boot的特性
EnableAutoConfiguration 自动装配Starter启动依赖 (开箱即用) 依赖于自动装配技术Actuator 监控Spring Boot CLI(命令行操作功能,groovy脚本)
Spring Boot 自动装配原理
四.Spring Boot整合Mybatis
Spring Boot整合Mybatis



