最近工作中有部分整改老接口的任务,大部分与Spring的拦截器,Tomcat相关,改到一些底层的代码发现,对基础J2EE的知识有些遗忘,需要频繁查阅,索性从头系统的整理一下Servlet和Filter的知识。 Servlet是什么 Servlet(Server Applet)是 Java Servl ...
分类:
编程语言 时间:
2020-12-29 12:03:15
阅读次数:
0
两个bean通过构造函数互为依赖项,spring容器就无法实例化这两个bean,会出现BeanCurrentlyInCreationException异常。 如何解决循环依赖: 1:加@Lazy注解 2: 使用setter注入(或字段上加@Autowired) 3:实现ApplicationCont ...
分类:
编程语言 时间:
2020-12-29 11:32:47
阅读次数:
0
improt.org.springframework.data.domain.sort包Criterialcritel=newCriterial();criterl.and("createTime").is(req.getCreateTime())Sortsort=Sort.by(sort.Diretion.DESC,mongod库对应属性)mongoTempalate.fin
分类:
数据库 时间:
2020-12-29 11:05:45
阅读次数:
0
spring boot全局捕获异常 制作人:全心全意 @ExceptionHandler:标识拦截异常 @ControllerAdvice:Controller的一个辅助类,最常用的就是作为全局异常处理的切面类 @ControllerAdvice可以指定扫描范围 @ControllerAdvice约 ...
分类:
编程语言 时间:
2020-12-29 11:02:27
阅读次数:
0
体系结构概述: @Bean 之前时候,在xml配置文件使用: <bean id="person" class="com.atguigu.bean.Person" scope="prototype" > <property name="age" value="${}"></property> <pro ...
分类:
编程语言 时间:
2020-12-28 12:01:10
阅读次数:
0
首先Spring Boot项目中都会如下启动类: @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application. ...
分类:
编程语言 时间:
2020-12-28 11:58:46
阅读次数:
0
spring源码有很多值得学习的地方,自己搭建了一套源码框架,方便跟踪和查看。对理解底层的结构有非常大的帮助。下面开始: step1 准备环境: 官方下载spring的源码:记得切换分支,我下的是5.1.x https://github.com/spring-projects/spring-fram ...
分类:
编程语言 时间:
2020-12-28 11:50:19
阅读次数:
0
名称与标识 id 使用了约束中的唯一约束。里面不能出现特殊字符的 name 没有使用约束中的唯一约束。里面可以出现特殊字符。 设置对象的生命周期方法 init-method Bean被初始化的时候执行的方法 destroy-method Bean被销毁的时候执行的方法(Bean是单例创建,工厂关闭) ...
分类:
编程语言 时间:
2020-12-28 11:33:21
阅读次数:
0
在对 Spring Batch 源代码进行编译的时候,提示仓库配置错误错误: org.gradle.api.resources.ResourceException: Could not get resource 'http://repo.spring.io/plugins-release/org/s ...
分类:
编程语言 时间:
2020-12-28 11:13:10
阅读次数:
0
Spring Boot + Layui + Spring Data JPA 实现前后端分离下简单增删改查分页操作 1.项目背景 自己搭着玩,写个小demo 2.项目构成 后端:Spring boot 2.3 JDK1.8 数据库:Spring Data JPA MySQL 5.7.31 前端: La ...
分类:
编程语言 时间:
2020-12-28 11:04:17
阅读次数:
0