随笔分类 -  Spring

摘要:@Service("taskExecutorFactory") public class TaskExecutorFactory implements ApplicationContextAware,InitializingBean { private ApplicationContext context; private static Map taskExecutorMap... 阅读全文
posted @ 2018-09-03 10:49 十七年的夏天 阅读(1070) 评论(0) 推荐(0)
摘要:@PostContruct是spring框架的注解,在方法上加该注解会在项目启动的时候执行该方法,也可以理解为在spring容器初始化的时候执行该方法。 阅读全文
posted @ 2018-06-29 13:53 十七年的夏天 阅读(2134) 评论(1) 推荐(1)
摘要:@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:trade.application.xml" }) public class BaseTest { } 阅读全文
posted @ 2018-06-24 17:25 十七年的夏天 阅读(862) 评论(0) 推荐(0)
摘要:接口说明:当一个类实现了这个接口之后,这个类就可以方便地获得 ApplicationContext 中的所有bean。换句话说,就是这个类可以直接获取Spring配置文件中,所有有引用到的bean对象。 在Web应用中,Spring容器通常采用声明式方式配置产生:开发者只要在web.xml中配置一个 阅读全文
posted @ 2018-05-03 23:11 十七年的夏天 阅读(277) 评论(0) 推荐(0)