用注解方式写定时任务
生活随笔
收集整理的這篇文章主要介紹了
用注解方式写定时任务
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
spring里加上? </context:component-scan>
<!--?任務自動掃描?-->
<task:annotation-driven/>
<!--?掃描位置?-->
<context:annotation-config/>??
????<context:component-scan?base-package="com.xxx.xxx"/>
然后在類上面添加注解 ?@Component,聲明他是一個組件
<!--?任務自動掃描?-->
<task:annotation-driven/>
<!--?掃描位置?-->
<context:annotation-config/>??
????<context:component-scan?base-package="com.xxx.xxx"/>
然后在類上面添加注解 ?@Component,聲明他是一個組件
轉載于:https://www.cnblogs.com/zhifengge/p/6180088.html
總結
以上是生活随笔為你收集整理的用注解方式写定时任务的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 长城宽带怎么装路由器 如何给长城路由器安
- 下一篇: MDX中Filter 与Exist的区别