One thing I forgot to mention was the usage of Spring message bundles. Usually, a ResourceBundleMessageSource is configured to inject bundle messages for Spring MVC. The only bad thing is that I could not specify an encoding for the configured message.properties files. As the default properties format is ISO 8859-1 character encoding and tedious operations like transformation of Unicode characters using native2ascii tool is necessary, I looked for a way to load UTF-8 resource files without any transformations. Spring has a ReloadableResourceBundleMessageSource class that allows just that, along with the reloadable behaviour. The bundle configuration now looks:

<bean id=”messageSource” class=”org.springframework.context.support.ReloadableResourceBundleMessageSource”>

<property name=”basename”>

<value>/WEB-INF/classes/messages</value>

</property>

<property name=”defaultEncoding”>

<value>UTF-8</value>

</property>

<property name=”cacheSeconds”>

<value>-1</value>

</property>

</bean>

Leave a Comment:

Your email address will not be published. Required fields are marked *