0
我在配置文件中定義的各種調度如下:如何在彈簧MVC控制器中調度方法?
<task:executor id="xxxxxExecutor" pool-size="${async.executor.pool.size}"/>
<task:scheduler id="xxxxwwwScheduler" pool-size="1" />
<task:scheduler id="qqqqSchedular" pool-size="1" />
<task:scheduler id="lastScheduler" pool-size="1" />
我的控制器已經通過註解@Controller被註釋。如何在Spring中的@Scheduled
註釋中指定特定的Scheduler
?
p.s.我正在嘗試使用@Scheduled
註釋在控制器中安排一種方法。
爲什麼你需要安排在控制器中?爲什麼你需要在你的web層中的處理方法?您不能在註釋中指定特定的調度程序,在'task:annotation-driven'上指定的調度程序是始終使用的調度程序。 –