zoukankan      html  css  js  c++  java
  • spring boot相关

    spring boot相关

    整合springMVC

    1. 编写自定义拦截器。(实现HandlerInterceptor类)
    2. 编写MVC配置类:实现webMvcConfig类。
      • 注册自定义拦截器。
      • 添加拦截器到拦截器链,重写addIntercepeter方法,拦截路径。
    3. spring boot默认数据库是Hikere。添加事务使用@Transactional
    4. 配置mybatis:配置别名、日志,配置mappscan。
    5. 使用通用mapper:
      • 添加依赖
      • 改造自定义mapper继承mapper
      • 修改启动类application中的Mapper扫描注解来源
      • 修改User实体类添加Jpa注解
      • 改造service

    spring boot配置

    1. 使用Java文件做配置文件
      • @configuration
      • @bean
      • @value
      • @propertySource
    2. 在配置类中使用EnableConfigrationProperties(基础类)读取数据
      使用多个yml文件时,统一使用前缀application-
      激活配置文件:
      • spring:profiles:active
    3. 当项目中有两个类型的配置文件时,两个类型配置文件都起作用,有同名的时候,以后缀为properties的文件为主
    4. 修改组件配置项流程:比如xx框架,找到对应的jar包,然后找到对应的packge,然后再找到xxproperties类,里面有要改的对应属性

    Junit测试

    在测试类上面添加@Runwith(SpringRuner.class)和@SpringBootTest

    Redis

    主要有String,hash,list,set,sortedset五种类型

  • 相关阅读:
    动态规划01背包
    动态规划矩阵连乘
    分治法归并排序
    动态规划最长公共子序列
    贪心算法活动安排
    分治法二分查找
    vue 可拖拽可缩放 vuedraggableresizable 组件常用总结
    rifilter in python discussed in 3delight
    3delight linear work flow
    pixar stereo rendering doc
  • 原文地址:https://www.cnblogs.com/mengzhao/p/14148784.html
Copyright © 2011-2022 走看看