views:

121

answers:

2

I nedd to localize application and now files are loaded from text files. Is it possible to change source to database?

This is how localized messages are now loaded:

<!-- Application Message Bundle -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="basename" value="/WEB-INF/messages/messages" />
    <property name="cacheSeconds" value="0" />
</bean>
A: 

You can implement your own by extending AbstractMessageSource

Bozho
A: 

Apparently this was asked in Spring some time ago but there were not enough people who wanted it I think.

https://jira.springsource.org/browse/SPR-364 is the JIRA and there is a JAVA file attached which is a good starting point (you need to set the SQL statement though)

Some relevant discussions are

http://forum.springsource.org/showthread.php?t=18194

http://forum.springsource.org/showthread.php?t=14610

Calm Storm