![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
zuijiu997
这个作者很懒,什么都没留下…
展开
-
springboot定时任务动态cron
转载:https://blog.csdn.net/u013998466/article/details/90373811转载 2020-12-09 11:13:16 · 117 阅读 · 0 评论 -
springboot定时任务配置多线程
前言 springboot只是配置@EnableScheduling和@Scheduled注解,默认情况下只会用单线程执行任务。要想使用多线程则还需要配置调度器和线程池。多线程可以让不同任务同一周期时刻执行。 配置 @EnableScheduling @EnableAsync public class SpringConfig extends WebMvcConfigurerAdapter { @Bean public TaskScheduler taskScheduler() {原创 2020-12-09 11:02:47 · 1316 阅读 · 0 评论 -
springmvc或者springboot 单元测试
springmvc或者springboot 单元测试 加上注解 注意: 一定要有@WebAppConfiguration,不然httpServletRequest和httpServletResponse不注入工厂 @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration(locations={"classpath:config/applicationContext.xml","classpath:原创 2020-11-17 15:43:55 · 71 阅读 · 0 评论