核心提示:123ApplicationContext spring =newClassPathXmlApplicationContext('classpath*:spring/applicationContex...
1
2
3 |
ApplicationContext spring = new ClassPathXmlApplicationContext( "classpath*:spring/applicationContext.xml" ); CommonBean job = (CommonBean)spring.getBean( "activityLotteryJob" ); |
配置:
1
2
3 |
< context:annotation-config /> < br >< br > < 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
Java免费学习 Java自学网 http://www.javalearns.com
关注微信号:javalearns 随时随地学Java
或扫一扫
随时随地学Java