First, let's set up a message bundler. The code snippet from the spring context is as follows:
<bean id="messageSource" class= "org.springframework.context.support. ReloadableResourceBundleMessageSource"> <property name="basename" value="classpath:messages" /> <property name="defaultEncoding" value="UTF-8" /> </bean>
Important points to note are as follows:
- class="org.springframework.context.support.ReloadableResourceBundleMessageSource": We are configuring a reloadable resource bundle. Support reloading properties through the cacheSeconds setting.
- <property name="basename" value="classpath:messages" />: Configure the loading of properties from the messages.properties and messages_{locale}.properties file. We will ...