排序
@Validated和@Valid区别及嵌套验证的实现
Spring Validation验证框架对参数的验证机制提供了@Validated(Spring's JSR-303规范,是标准JSR-303的一个变种),javax提供了@Valid(标准JSR-303规范),配合BindingResult可以直接提供参数...
Spring中任务调度cronExpression配置说明
Spring定时任务配置项cronExpression详细说明: 字段 字段 允许值 允许的特殊字符 秒 0-59 , - * / 分 0-59 , - * / 小时 0-23 , - * / 日期 1-31 , - * ? / L W C 月份 1-12 或者 JAN-DEC , - ...
CentOS7将SpringCloud服务配置成后台服务并设置开机自启的N种方式
1. 环境说明 * CentOS Linux release 8.2.2004 (Core) 2. 配置方式 2.1 运行shell脚本的方式 1)创建脚本 在/usr/bin目录下创建脚本,比如我的脚本名为/usr/bin/ruoyi-gen.sh,内容如下: #!/bi...
Content type ‘application/x-www-form-urlencoded;charset=UTF-8’ not supported解决
Spring报错:org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported,具体解决办法如下: @PostMappin...
Springboot提示No beans of ‘RestTemplate’ type found错误
错误信息 在使用RestTemplate时,IntelliJ Idea提示Could not autowire. No beans of 'RestTemplate' type found.。 代码清单: @Component public class SmsUtil { @Autowired private RestTem...
SpringMVC框架整合Mybatis配置多个数据库
环境 Spring:3.1; Mybatis:3.1; 数据库:我这里是不存在主从关系的、相互独立的两个oracle数据库; 需求 系统本身是Oracle数据库,但是系统中的个别功能是查询另外的数据库(我这里是echarts...
Springboot通过FeignClient使用MultipartFile上传本地文件
Spring通过FeignClient调用文件上传服务上传本地磁盘文件代码如下: //2. 图片解码并保存 String filename = UUID.randomUUID() + '.jpg';//文件名+后缀名 String originalFilename = uploadPat...
普通Java类获取Spring Bean的实现方式
方式1:实现ApplicationContextAware接口 步骤: 1.写一个工具类,实现ApplicationContextAware接口; 2.将此工具类在spring配置文件中配置; 3.在类中调用; 工具类代码: public class Spring...
Spring Boot通过注解读取配置文件内容的几种方式?
Spring为我们提供的从配置文件中读取配置信息的方式主要有以下几种。 示例配置文件:application.yml,内容如下: wuhan2020: 2020年初武汉爆发了新型冠状病毒,疫情严重,但是,我相信一切都会...
已解决:spring boot报错SizeLimitExceededException
错误 spring boot报错: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (71401393) exceeds the configured...

