06 2023 档案

摘要:Spring 中定时任务有两种实现方式:1.@Scheduled(cron表达式)2.基于SchedulingConfigurer注册定时任务这两者的区别主要有1.@Scheduled不支持动态修改定时周期,只能停止服务器,修改cron表达式,再启动服务器;SchedulingConfigurer可 阅读全文
posted @ 2023-06-27 14:14 KeepSmiling_me 阅读(1798) 评论(0) 推荐(0) 编辑
摘要:<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.7.7</version> </dependency> import cn.hutool.cache.CacheUtil; 阅读全文
posted @ 2023-06-08 10:29 KeepSmiling_me 阅读(53) 评论(0) 推荐(0) 编辑
摘要:spring mvc给我们提供了一个@RestControllerAdvice来增强所有@RestController,然后使用@ExceptionHandler注解,就可以拦截到对应的异常。 @RestControllerAdvice public class ControllerExceptio 阅读全文
posted @ 2023-06-07 09:56 KeepSmiling_me 阅读(58) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示