
springboot总结
文章平均质量分 56
Smaksze
集中起来的意志可以击穿顽石
展开
-
解决springboot不扫描@repository的问题
问题:单独使用@repository注解注dao层,而且不使用@mapperscan扫描时,启动项目会报错:Field xxxxMapper in com.sms.shiro.service.impl.xxxxServiceImpl required a bean of type ‘com.sms.shiro.mapper.xxxxMapper’ that could not be found. 一,@mapper和@repository的区别: 1.@mapper是mybatis的注解,@reposit原创 2021-06-09 09:43:44 · 4628 阅读 · 2 评论 -
SpringBoot静态资源的映射
一, webjars 所有的webjars被导入后,目录结构都是这样的 : springboot的底层告诉我们 , 如果要引用webjars , 我们只需要在引用的位置使用 " /webjars/ “** ,springboot就会去 " classpath: /MATA-INF/resources/webjars " 下找资源文件 . 因此 , 若要导入bootstrap的webjars,在引入依赖后 , 直接< link href=” /webjars/bootstrap/4.0.0/css/b原创 2020-09-01 17:24:48 · 247 阅读 · 0 评论 -
SpringBoot源码分析
SpringBoot自动装配的原理: 一 . springboot在启动时会加载大量的自动装配类( XxxAutoConfiguration ) ,但是有的生效了,有的没有生效. 这些自动装配配使用 二 . 我们看我们需要的功能有没有在SpringBoot默认写好的配置类当中; 三. 我们在来看这个自动配置类中到底配置了哪些组件;( 只要我们要用的组件存在其中我们就不需要在手动配置了 ) 四 . 给容器中自动配置类添加组件时 , 会从XxxProperties类中获得某些相关的属性.我们只需要在配置文件中指原创 2020-08-27 14:28:06 · 183 阅读 · 0 评论