
springboot
springboot
飞乐鸟
你必须变成自己希望的样子,世界才能变成你想要的样子!
展开
-
springboot如何自动配置
首先我们都知道springboot都是基于注解简化配置,启动类注解@SpringBootApplication+run方法就实现大量starter自动配置,源码:@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Documented@Inherited@SpringBootConfiguration@Enabl...原创 2020-03-12 22:15:38 · 101 阅读 · 0 评论 -
springboot学习
springboot帮助开发者更容易的创建基于spring的应用程序和服务,为spring生态系统提供了一种固定的,约定优于配置风格的框架。springboot特性:1.为基于sprin的开发提供更快的入门2.开箱即用,没有xml配置,没有代码生成,同时也可以修改默认值来满足特定的需求;3.提供了一些大型项目中常见的非功能性特性,转载 2017-10-10 18:11:04 · 203 阅读 · 0 评论 -
springboot优雅校验参数
1、pom引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency>2、全局异常处理@RestControllerAdvice配合@Exc..原创 2021-10-23 15:09:14 · 145 阅读 · 0 评论 -
springboot集成swagger2 避坑
pom文件添加依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> &l...原创 2020-10-31 11:31:49 · 276 阅读 · 0 评论 -
SpringBoot+Sharding-JDBC操作分库分表
什么是Sharding-JDBC?什么是分库分表?为什么要分库分表?可查看本篇博客:Apache——ShardingSphere(分布式数据库中间件、对于分库分表的操作利器)Sharding-JDBC操作水平分表一、搭建环境基础环境:SpringBoot2.2.1 + MybatisPlus + Sharding-JDBC + Druid连接池 创建SpringBoot工程 修改SpringBoot项目版本为2.2.1 引入相关依赖 <d...转载 2021-01-12 20:04:28 · 579 阅读 · 0 评论 -
ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata
<groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.2.RELEASE</version>springboot版本问题,从2.4.2换成了2.3.2.RELEASE,启动成功由于2.4.2删除了ConfigurationBeanFactoryMetadata这个类.原创 2022-01-29 11:00:07 · 1002 阅读 · 0 评论 -
springboot profiles多环境配置
pom文件配置<profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <profiles.acti原创 2021-08-20 15:34:46 · 870 阅读 · 0 评论 -
Springboot中@RequestBody接收的对象传入首字母大写的参数时,无法接收到参数值
变量上添加@JsonProperty("")注解@JsonProperty("Voucher")private String Voucher;原创 2021-07-30 13:32:14 · 430 阅读 · 0 评论 -
注解ServletComponentScan、ComponentScan、Configuration
@ServletComponentScan在SpringBoot的main方法上使用@ServletComponentScan注解后,Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册@ComponentScan只要标注了@Controller,@Service,@Repository,@Component这四个注解都会被扫描到容器中@Configuration说明是个配置文件,和原来xml配置是一样原创 2020-11-02 16:46:11 · 345 阅读 · 0 评论