Is there any way to enable or disable the Spring bean definition in applicationContext.xml file?
问题 Is there any way to enable or disable a java bean definition in application context? <bean id="enBean" classs="com.en.bean.BeanName"> <property name="prop1"/> </bean> Or, is there any way to load the bean conditionally defined in application context? 回答1: There is a new feature @Profile in spring 3.1 that would do the job From here Spring 3.1 introduces the concept of environment profiles. A common use case is the setting up of beans that are different between development, QA and production