Is it possible to have multiple resource bundles in spring mvc? I want to separate my resource bundles for example one for errors, another for global messages, other for image names etc. so I don't have just one very big file
I'm using this
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="messages" />开发者_Go百科
</bean>
But here i can just specify 1 resource, can I use more?
You can just pass in a list using the setBasenames() method like this:
<beans>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>images</value>
<value>errors</value>
<value>globalMsgs</value>
</list>
</property>
</bean>
</beans>
精彩评论