我正在开发一个基于 Spring 的 Web 应用程序。要求如下:
用户输入日期(字符串格式)。
为该日期安排一项任务(仅一次)。
我的代码是:
calendar.setTime(formatter.parse(dateFromForm));
int day = calendar.get(Calendar.DAY_OF_MONTH);
int month = calendar.get(Calendar.MONTH);
.
.
String cornExp = "0 "+minutes+" "+hours+" "+day+" "+month+" "+year;
我想将cornExp
价值传递给:
@Scheduled(cron=**cornExp**)
我怎样才能做到这一点?