Tuesday, 22 March 2016

How to include message property file in Spring

Please include the below lines of code in application-context.xml and specify the exact path of the message property files. Here in the below example the files such as messages_en.properties are included in META-INF/messages  folder.

<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
p:basename="classpath:META-INF/messages">
<property name="defaultEncoding" value="UTF-8" />
<property name="fileEncodings" value="UTF-8" />
</bean>

No comments:

Post a Comment