我即将扩展org.springframework.context.support.AbstractMessageSource,它允许我在Spring中动态添加和编辑消息。我计划将这些值存储在数据库中。有什么东西可以做到这一点吗?我应该想到一种不同的方法吗?
以下是要求:
答案 0 :(得分:0)
不确定
开发自定义MessageSource并将其设置为现有的父级(例如,基于属性文件)。
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>message/messages</value>
</list>
</property>
<property name="parentMessageSource">
<bean class=com.example.DatabaseMessageSource"/>
</property>
</bean>