笔记
千千晩星
昔我往矣,杨柳依依。今我来思,雨雪霏霏。
展开
-
postman传参时,解决Date类型参数的格式化问题初体验01
在使用postman测试接口时,需要的是Date类型的参数,当传入一个yyyy-MM-dd格式的参数时,会出现异常:下面展示一些 异常片段。// 错误org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errorsField error in object 'xxx' on field 'beginAt': rejected value [原创 2021-06-24 14:16:38 · 2468 阅读 · 1 评论 -
小白踩坑记:spring初始化时出现:factory-bean reference points back to the same bean definition
意思说的是你的factory-bean指向同一个bean定义,经过查看发现,我的类名和方法名一样(忽略大小写,因为当不指定名字时,默认是首字母小写作为bean的名字)//@Servicepublic class JedisPool { @Autowired RedisConfig redisConfig; @Bean public redis.clients.jedis.JedisPool jedisPool(){ JedisPoolConfig jed原创 2020-12-18 16:13:57 · 4773 阅读 · 6 评论 -
小白踩坑记:springboot整合mybatis时遇到的坑----
嗨呀,好气!!!今天在用springboot整合mybatis时,连踩数坑,摔得我头昏脑涨嗡嗡直响,所有的坑都被我踩了一遍,下面就记录一下令人崩溃的三个小时- - -先是来个UserDao找不到:Field userDao in com.dec14.service.UserService required a bean of type 'com.dec14.dao.UserDao' that could not be found.The injection point has the followi原创 2020-12-14 17:40:48 · 810 阅读 · 1 评论 -
小白踩坑记:springboot运行一直报错:There was an unexpected error (type=Not Found, status=404).
唉,最近在学习springboot集成thymeleaf模板引擎时,明明都配置的好好的,却一直给爷报错,给小爷整懵了:更奇特的是,就挺秃然的就发现似乎哪里有问题了,一经改正,终于拨云见日了。。。首先,我的controller和html页面反复好几遍,确认无误:controller:@Controller@RequestMapping("/first")public class firstController { @RequestMapping("/thyme") public原创 2020-12-14 11:38:02 · 7867 阅读 · 0 评论 -
小白Spring学习记:Spring容器的整个创建流程(with 部分源码)
目前来说,Spring框架的重要性无需赘述,它良好的兼容性和适配性使得它经久不衰。本小白今天就来对Spring框架中的容器创建过程进行学习。作为新手,含泪把整个生命周期流程进行了一番撕咬,终于明了一些。直接从容器的创建说起:在context的构造方法里,调用refresh()方法,进行容器的刷新创建的。// refresh()刷新创建容器public AnnotationConfigApplicationContext(Class<?>... componentClasses) {原创 2020-12-11 20:31:15 · 201 阅读 · 2 评论 -
小白踩坑记:Idea配置使用Mybatis时出现Could not find resource com/dec08/dao/GoodsDaoImpl.xml
今天在idea中整合mybatis和spring时,由于疏忽,导致出现了:org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mySqlSessionFactory’ defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exceptio原创 2020-12-08 16:28:08 · 476 阅读 · 0 评论 -
小白学习Spring-AOP 笔记
Spring-AOPAOP(Aspect Oriented Programming),意为:面向切面编程,是OOP的延续,是软件开发中的一个热点,也是Spring框架中的一个重要内容,是函数式编程的一种衍生范型。利用AOP可以对业务逻辑的各个部分进行隔离,从而使得业务逻辑各部分之间的耦合度降低,提高程序的可重用性,同时提高了开发的效率。在Spring框架中,aop是基于动态代理实现的。简单来说,aop有以下几种功能:1、增强功能2、减少重复代码3、使得你专注于业务代码4、解耦合那么作为新手,该原创 2020-12-07 16:52:10 · 133 阅读 · 0 评论