Java – override spring: message tags with database values

I use spring to display messages in the properties file I want to be able to override the < spring: Message > tag to use the values in the database based on the logged in user If this value does not exist, I want it to now default to the current value in the properties file

Can someone help me with this code? I've read about abstractmessagesource, but I don't know how to implement it

thank you

Solution

You must implement a custom message source It is a class that extends abstractmessagesource and implements the abstract resolvecode (Java. Lang. string, Java. Util. Locale) method There are nearly 7000 on so (it's Grails' solution), but I think it's better to start from

Look at the topics in the spring Forum:

> AbstractMessageSource using DB table instead of props file? > i18n and the database > database-backed resourcebundle for i18n and dynamically adding new langs > Database Driven Resource Bundles – Examples and best practice?

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>