Spring的i18n配置:
<!-- conf:i18n -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="fallbackToSystemLocale" value="false" />
<property name="useCodeAsDefaultMessage" value="true" />
<property name="defaultEncoding" value="UTF-8" />
<property name="cacheSeconds" value="60" />
<property name="basenames">
<list>
<value>classpath:com/hupu/nac/i18n/message</value>
</list>
</property>
</bean>
Spring的i18n使用:
package com.joyce.enums;
import java.util.Locale;
/**
* 语言枚举
* @author Joyce.Luo
* @date 2016-1-5 上午09:38:27
* @version V3.0
* @since Tomcat6.0,Jdk1.6
*