Spring and MessageResolvers

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Spring and MessageResolvers

tixe
is it possible to load in the same template messages taken from different .properties files?
Reply | Threaded
Open this post in threaded view
|

Re: Spring and MessageResolvers

Zemi
Administrator
Hello,

in Spring you could define chained message sources, provided by the interface HierarchicalMessageSource.

For example, if you have your i18n files
   baseMessages.properties
and
   messages.properties

you could chain them as

    <bean id="baseMessageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename" value="baseMessages" />
    </bean>
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename" value="messages" />
        <property name="parentMessageSource" ref="baseMessageSource" />
    </bean>

Reply | Threaded
Open this post in threaded view
|

Re: Spring and MessageResolvers

tixe
thanks