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
时间: 2024-10-11 07:36:46