立即学习:https://edu.csdn.net/course/play/25330/298878?utm_source=blogtoedu
1.spring boot开发工具:
ECLIPSE(sts插件) --> STS
IntelliJ IDEA
2.目录结构:
resources
static:静态资源(js,css 图片 音频 视频)
templates:模板文件(模板引擎freemaker, thymeleaf,默认不支持JSP)
application.properties:配置文件
3.web程序:
传统方式:webContext web.xml war tomcat
SpringBoot内置了tomcat,并且不需要打成war包再执行
可在application.properties对对端口号等服务端信息进行配置
4.spring boot将各个应用/三方框架 设置成了一个个“场景”starter,以后要用哪个,只需要引入哪个场景即可。选完之后,Springboot就会将该场景需要的所有依赖自动注入。例如选择"web",spring boot就会将web相关的以来(tomcat json)全部引入本项目
5.@SpringBootApplication:spring boot的住配置类
该注解包含:
@SpringbootConfiguration:包含@Configuration,表示“配置类”
spring.xml --> 配置类 a.在类上面修饰,表示该类适用于配置的类 b.该类会自动纳入Spring容器(@Component)
@EnableAutoConfiguration
myhbatisConfig.xml/springmvc.xml
该注解可以使spring boot自动配置。约定优于配置
@EnableAutoConfiguration-->@AutoConfigurationPackage-->@import-->注册扫描包