在Spring中使用@scheduled注释的多个cron表达式?
我想在每个月的最后一天触发一个方法。 我用的是弹簧在Spring中使用@scheduled注释的多个cron表达式?,spring,spring-mvc,Spring,Spring Mvc,我想在每个月的最后一天触发一个方法。 我用的是弹簧 @scheduled annotation @Scheduled(cron = "${attendance.cron.schedule}") 如何让Spring在不同的计划时间执行 我不能用0 15 10 L* 您已经开始使用占位符${attention.cron.schedule}。因此,我相信您只需要将attention.cron.schedule外部化到您的属性文件中,您就可以进行设置了 对于Spring,您可能最终会使用它。 如果您
@scheduled annotation @Scheduled(cron = "${attendance.cron.schedule}")
如何让Spring在不同的计划时间执行
我不能用0 15 10 L* 您已经开始使用占位符${attention.cron.schedule}。因此,我相信您只需要将attention.cron.schedule外部化到您的属性文件中,您就可以进行设置了 对于Spring,您可能最终会使用它。
如果您已经使用Spring Boot,它提供了很多选项。您需要在运行时更改它,还是在重新加载上下文后更改它?感谢您在重新加载上下文时的响应