如何设置bean是非必需的
- 工程中
messageSource
这个bean
是非必需的,要求messageSource
注入失败时,Spring容器也能启动,Spring的xml配置文件中有这种选项吗,或者有其它方法解决这个问题吗?先多谢啦!
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:i18n/messages" />
<property name="defaultEncoding" value="UTF-8"/>
</bean>
好像并没有这种配置,如果不用的话,只要保证bean对应的class存在应该就没什么问题了吧