You have to implement custom message source. It's a class that extends AbstractMessageSource
and implements the abstract resolveCode(java.lang.String, java.util.Locale)
method. There is almost same question on SO (it's solution for Grails), but I think it is good point to start from...