Spring
liweigov
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
通过Spring实现定时任务
第一步:实现TimerTaskpackage com.demo;import java.util.TimerTask;public class TaskextendsTimerTask {public void run() { //ti原创 2011-07-23 14:51:52 · 257 阅读 · 0 评论 -
Servlet获取Spring bean
场景:有时在servlet中需要使用Spring bean,如上传图片等 处理方法:重写Servlet的init方法,通过WebApplicationContextUtils获得,代码如下: public void init() throws ServletException {原创 2011-07-23 15:09:23 · 692 阅读 · 0 评论 -
通过实现ApplicationContextAware接口获取bean
场景:在某个bean中需要动态获取其它bean 实例代码:packageorg.company.xxx; importorg.springframework.beans.BeansException;importorg.springframework.context.App原创 2011-07-23 15:16:47 · 663 阅读 · 0 评论 -
Spring-quartz定时任务
背景:需要在每天固定某个时间触发实现:通过Spring-quartz定时任务实现1、定义定时任务执行类,不需实现或继承任何借口或抽象类/** * 测试定时任务*/package com.test.TestTrigger;public class TestTrigger{ /** * 定时任务调用方法 */ public void myTrigger(转载 2011-11-11 14:03:39 · 716 阅读 · 0 评论 -
Spring线程池ThreadPoolTaskExecutor
1.配置<!-- spring thread pool executor --> <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"> <!-- 线程池维护线程的最少数量 -...转载 2019-08-07 13:59:06 · 239 阅读 · 0 评论
分享