SpringBoot2.0总结

与SpringCloud关系

与SpringMVC关系

与JFinal区别

 

常用注解: @RestController  @EnableAutoConfiguration   @ComponentScan  @ResponseBody  @ControllerAdvice  @SpringBootApplication

 

Web开发组件:

      静态资源访问  

     全局捕获异常

     渲染Web页面

              Freemarker    JSP    Thymeleaf

 

SpringBoot热部署

       热部署原理

       Spring-Boot-Devtools支持热部署

       SpringLoaded支持热部署

 

SpringBoot整合数据库访问:

   整合Mybatis

   整合Jdbc

   整合SpringJpa

   整合多数据源

 

SpringBoot整合事务管理

    整合注解版事务

    整合表达方式事务

    分布式事务管理:  JTA   Atomikos

 

日志管理

    Log4记录日志

    AOP统一处理web请求日志

 

 

  缓存支持

      整合EhCache

      整合Redis

 

  定时任务

    SpringBoot定时任务@Schedule

  异步调用

     @Async实现异步调用

 

 多环境配置

     分布式配置中心

     不同环境存放配置文件

 

监控管理

   Actuator监控应用

   Admin-UI分布式微服务监控中心

 

性能优化  

   自定扫描优化

   Servlet容器变为Undertow

   内存优化

   JVM参数调优

   分析Positive matches

 

 

2.0新特性

   基于Java8  支9

  SpringWebFlux响应编程

   对Kotlin支持

   支持Quartz

   引入Oauth2.0

 

SpringBoot项目打包部署

 

 

优点:

 使用嵌入的Servlet容器,用用无需打成war包

  starters自动依赖于版本控制

 

用spring boot 快速构建一个微服务单元

 

给maven 的settings.xml配置文件的profiles标签添加,表示用jdk1.8 编译运行

<profile>
  <id>jdk‐1.8</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>1.8</jdk>
  </activation>
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
  </properties>
</profile>
<!‐‐ 这个插件,可以将应用打包成一个可执行的jar包;‐‐>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring‐boot‐maven‐plugin</artifactId>
            </plugin>
        </plugins>
    </build>

 

spring-boot-starter-web:
spring-boot-starter:spring-boot场景启动器;帮我们导入了web模块正常运行所依赖的组件;
Spring Boot将所有的功能场景都抽取出来,做成一个个的starters(启动器),只需要在项目里面引入这些starter
相关场景的所有依赖都会导入进来。要用什么功能就导入什么场景的启动器

 

关于配置:

 spring boot不推荐使用xml了

 使用全注解的方式

    @Configuration+@Bean

 

posted @ 2019-02-11 16:37  toov5  阅读(306)  评论(0编辑  收藏  举报