
spring
文章平均质量分 76
spring 全家桶
chrislin9
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
jackson 总结
文章目录简介常用方法总结自定义序列化与自定义反序列化jackson 序列化注解(正向)jackson 反向序列化jackson 注解 通用参考简介Jackson 2.x版提供了三个JAR包供下载:Core库:streaming parser/generator,即流式的解析器和生成器。Annotations库:databinding annotations,即带注释的数据绑定包。Databind库:ObjectMapper, Json Tree Model,即对象映射器,JSON树模型。从J原创 2021-05-05 23:38:11 · 448 阅读 · 0 评论 -
swagger 总结
Swagger 常用注解说明Swagger 通过注解表明该接口会生成文档,包括接口名、请求方法、参数、返回信息的等等。常用注解@Api:修饰整个类,描述 Controller 的作用@ApiOperation:描述一个类的一个方法,或者说一个接口value 字符串 可用在方法头上.参数的描述容器notes 字符串 说明httpMethod 字符串 请求方法@ApiParam:单个参数描述@ApiModel:用对象来接收参数@ApiModelProperty name 字符串 实体类参原创 2021-05-05 23:03:01 · 336 阅读 · 0 评论 -
springboot 自动装配
springboot 自动装配1、@Component注解及其派生注解2、@Indexed@Indexed (为 Spring 模式注解添加索引,以提升应用启动性能) 是spring5中先加的注解在@Component注解中,Spring读取@Component组件(派生性)(预编译@Component注解及@Component的派生注解),有两种实现方式,一种是反射,一种是ASM。反...原创 2020-07-25 10:01:30 · 164 阅读 · 0 评论 -
web.xml 配置分析
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun原创 2020-07-25 09:55:08 · 111 阅读 · 0 评论 -
JPA 一级缓存导致查询数据不一致问题
使用 EntityManager 消除缓存通过 em.clear();,在每次查询前清除 JPA 缓存,可解决后续查询直接返回第一次查询数据的问题自定义 Repository 接口类public interface FinancialTrendRepository { List<MonthlyTrendEntity> selectAssetLiquidTrend(); List<MonthlyTrendEntity> selectAssetFixedTrend转载 2020-07-18 15:06:30 · 1994 阅读 · 0 评论 -
SpringBoot之HandlerInterceptor拦截器
详解简述最常用的登录拦截、或是权限校验、或是防重复提交实现定义一个Interceptor 非常简单方式也有几种,我这里简单列举两种1、类要实现Spring 的HandlerInterceptor 接口2、类继承实现了HandlerInterceptor 接口的类,例如 已经提供的实现了HandlerInterceptor 接口的抽象类HandlerInterceptorAdapter其实以前都是继承WebMvcConfigurerAdapter类 不过springBoot2.0以上 WebMv原创 2020-07-07 11:15:24 · 424 阅读 · 0 评论 -
spring事务隔离级别与传播机制
隔离级别:1、ISOLOCATION_DEFAULT: 数据库默认级别2、ISOLOCATION_READ_UNCOMMITTED: 允许读取未提交的读, 可能导致脏读,不可重复读,幻读3、ISOLOCATION_READ_COMMITTED: 允许读取已提交的读,可能导致不可重复读,幻读4、ISOLOCATION_REPEATABLE_READ : 不能能更新另一个事务修改单尚未提交(回滚)的数据,可能引起幻读5、ISOLOCATION_SERIALIZABLE: 序列执行效率低传播级别(原创 2020-07-07 09:49:18 · 203 阅读 · 0 评论 -
SpringCloud Gateway 整理总结
如果你引入了starter,但不想开启gateway,可以设置 spring.cloud.gateway.enabled=falseSpring Cloud Gateway-术语Route: 网关基本构件块。它由ID、目标URI、predicates 断言集合和filters过滤器集合定义。如果聚合断言为真,则匹配路由。Predicate: Java 8 Function Predicate. 输入类型是 Spring Framework ServerWebExchange. 这允许开发人员匹..原创 2020-07-03 14:27:55 · 389 阅读 · 0 评论 -
springcloud config 配置访问
springcloud http请求地址和资源文件映射如下:/ { 应用名 } / { 环境名 } [ / { 分支名 } ]/ { 应用名 } - { 环境名 }.yml/ { 应用名 } - { 环境名 }.properties/ { 分支名 } / { 应用名 } - { 环境名 }.yml/ { 分支名 } / { 应用名 } - { 环境名 }.propertieslabel 分支名 配置文件的分支,默认是master。application 应用名profile原创 2020-06-30 18:19:31 · 2805 阅读 · 0 评论 -
springcloud config配置读取优先级
参考springcloud config配置读取优先级原创 2020-06-29 17:28:21 · 524 阅读 · 0 评论 -
spring web REST 处理流程
参考Spring Web MVC REST 处理流程SpringBoot原理学习之web mvc rest1-----请求流程解析处理流程转载 2020-05-27 15:22:18 · 197 阅读 · 0 评论 -
spring mvc 请求流程-待整理
spring framework:spring 模式注解spring 应用上下文spring工厂加载机制spring 应用上下文初始化器spring Environment 抽象spring 应用事件/监听器springboot:springApplicationspringApplication Builder APispringApplication 运行监听器springApplication 参数springApplication 故障分析...原创 2020-05-27 14:31:01 · 143 阅读 · 0 评论 -
springboot Application
推断 Web 应用类型根据当前应用 ClassPath 中是否存在相关实现类来推断 Web 应用的类型,包括:Web Reactive: WebApplicationType.REACTIVEWeb Servlet: WebApplicationType.SERVLET非 Web: WebApplicationType.NONE参考方法: org.springframework.boot.SpringApplication#deduceWebApplicationTypeREACTIVE_WEB原创 2020-05-26 16:01:22 · 172 阅读 · 0 评论 -
EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})作用
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})@EnableAutoConfiguration作用:Spring Boot会自动根据你jar包的依赖来自动配置项目。例如当你项目下面有HSQLDB的依赖时,Spring Boot会创建默认的内存数据库的数据源DataSource,如果你自己创建了DataSource,Spring Boot就不会创建默认的DataSource。个人理解: 如果你用了Mybatis转载 2020-05-11 18:07:32 · 2684 阅读 · 0 评论 -
spring aop
AOP使用场景AOP用来封装横切关注点,具体可以在下面的场景中使用:Authentication 权限Caching 缓存Context passing 内容传递Error handling 错误处理Lazy loading 懒加载Debugging 调试logging, tracing, profiling and monitoring 记录跟踪 优化 校准Performan...原创 2019-12-15 09:30:30 · 89 阅读 · 0 评论 -
HttpStatus状态详解
常用HttpStatus状态:HttpStatus.OK = 200;HttpStatus.BADREQUEST = 400;HttpStatus.FORBIDDEN = 403;HttpStatus.NOTFOUND = 404;HttpStatus.TIMEOUT = 408;HttpStatus.SERVERERROR = 500;HttpStatu...转载 2019-12-01 21:02:26 · 238 阅读 · 0 评论 -
spring boot过滤器FilterRegistrationBean实现
参考:https://www.jb51.net/article/172128.htmhttps://www.cnblogs.com/ixixi/p/11685269.html原创 2019-12-02 19:00:54 · 467 阅读 · 0 评论 -
springboot swagger配置
1、注解描述@Api:描述Controller @ApiIgnore:忽略该Controller,指不对当前类做扫描 @ApiOperation:描述Controller类中的method接口 @ApiParam:单个参数描述,与@ApiImplicitParam不同的是,他是写在参数左侧的。如(@ApiParam(name = "username",value = "用户名")...原创 2019-11-25 09:12:41 · 345 阅读 · 0 评论 -
springboot 通用Mapper与分页插件的集成
1、<!-- 分页插件 文档地址:https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md --><dependency> <groupId>com.github.pagehelper</groupId> <art...原创 2019-11-25 09:10:37 · 225 阅读 · 0 评论 -
SpringBoot日志配置
1、logback是没有FATAL级别的日志,它将被映射到ERROR时间日期:精确到毫秒,可以用于排序 日志级别:ERROR、WARN、INFO、DEBUG、TRACE 进程ID 分隔符:采用---来标识日志开始部分 线程名:方括号括起来(可能会截断控制台输出) Logger名:通常使用源代码的类名 日志内容:我们输出的消息2、日志输出界别配置 12...原创 2019-11-25 09:05:17 · 110 阅读 · 0 评论