spring
lvhui321
这个作者很懒,什么都没留下…
展开
-
Boot 自动配置覆盖
当前项目中新建配置bean覆盖第三方配置bean原创 2022-06-27 20:02:38 · 877 阅读 · 0 评论 -
Invalid bound statement (not found)解决方法总结
一、项目编译完成后,检查*mapper.xml是否构建进项目,请查看target文件夹下面*mapper.xml这些是否存在,若没有,请重新构建。二、检查扫描xml的locations是否正确,例如:1)resource目录下的mapper,配置文件配的mappers;2)*mapper.xml放错位置三、检查*mapper.xml文件的namespace是否正确四、*mapper.xml中sql语句的id和namespace中的mapper.java类方法名字是否相同五、若确认没有以上问题,请任意修改对应原创 2022-06-23 16:55:16 · 347 阅读 · 0 评论 -
spring 接收http请求参数方式
第一:请求路径参数1.@PathVariable获取路径参数,如:url/{id}这种形式,接收注解@PathVariable("id") String userId2、@RequestParam获取查询参数,即url?name=zhangsan这种形式,接收注解@RequestParam(name = "name") String name3、@RequestBody请求含有Body,如Post请求中xml,json等数据格式,接收注解@RequestBody Pe.原创 2021-09-18 14:50:46 · 634 阅读 · 0 评论 -
Boot 自动装配原理
1.在boot启动时加载@SpringBootApplication注解2.解析@EnableAutoConfiguration注解3.解析对应的@Import将一个对象添加到IoC容器中4.执行ImportSelector接口的实现5.加载META-INF/spring-autoconfigure-metadata.properties的注解元数据信息6.加载META-INF/spring.factories各种类路径,第三方扩展也会通过SPI加载对应的文件...原创 2021-07-13 17:41:08 · 267 阅读 · 0 评论 -
Boot 热部署
1.idea中打开settings,找到Build,Execution,Deployment选中compiler,在Build project automatically打对勾2.快捷键ctrl+shift+alt+'/',选择Registry中的compiler.automake.allow.when.app.running3.pom添加spring-boot-devtools依赖和maven配置 <dependency> <groupId&..原创 2021-07-13 09:38:17 · 358 阅读 · 1 评论 -
Boot 手动获取bean
第一种1.@Componentpublic final class SpringUtils implements BeanFactoryPostProcessor{ /** Spring应用上下文环境 */ private static ConfigurableListableBeanFactory beanFactory; @Override public void postProcessBeanFactory(ConfigurableListableBea原创 2021-07-13 09:29:22 · 357 阅读 · 1 评论 -
Spring 事件(Application Event)
1.解释Spring的事件使Bean和Bean之间的消息可以互相通信,当一个Bean处理完一个任务之后,希望能够被其它Bean感知到并作出相应的处理,这时就需要让其它Bean监听当前Bean所发生的事件。2.自定义事件2.1自定义事件,集成ApplicationEventpackage com.demo.test.event;import org.springframework.context.ApplicationEvent;/** * @author th * * @d原创 2021-07-11 21:47:00 · 480 阅读 · 1 评论 -
Boot异常处理-自定义错误页面
1.在pom中添加依赖包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>2.在resources/templates中添加名为error.html原创 2021-07-11 09:54:55 · 166 阅读 · 1 评论 -
AG-Admin 学习之路
一、AG-Admin简介AG-Admin是基于Spring Cloud微服务化开发平台,具有统一授权、认证后台管理系统,其中包含具备用户管理、资源权限管理、网关API管理等多个模块,支持多业务系统并行开发,可以作为后端服务的开发脚手架。核心技术采用Eureka、Fegin、Ribbon、Zuul、Hystrix、JWT Token、Mybatis等主要框架和中间件,前端采用vue-elemen...原创 2018-06-30 17:01:19 · 2917 阅读 · 0 评论