spring的BeanFactory加载过程

ApplicationContext spring = new ClassPathXmlApplicationContext("classpath*:spring/applicationContext.xml");

CommonBean job = (CommonBean)spring.getBean("activityLotteryJob");

配置:

<context:annotation-config/> 

<context:component-scan base-package="com.cc"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan>

@Autowired  AutowiredAnnotationBeanPostProcessor  

@Resource CommonAnnotationBeanPostProcessor

@PersistenceContext PersistenceAnnotationBeanPostProcessor 

@Required   RequiredAnnotationBeanPostProcessor

DispatcherServlet的初始化过程:

initMultipartResolver(context);
initLocaleResolver(context);
initThemeResolver(context);
initHandlerMappings(context);
initHandlerAdapters(context);
initHandlerExceptionResolvers(context);
initRequestToViewNameTranslator(context);
initViewResolvers(context);

posted on 2016-09-23 11:33  微雨竹窗夜话..  阅读(577)  评论(0编辑  收藏  举报

导航