增加系统国际化配置

This commit is contained in:
dell
2018-01-16 09:57:12 +08:00
parent 0597c974e8
commit f45edaddb5
10 changed files with 196 additions and 22 deletions

View File

@@ -262,8 +262,18 @@
<!--<property name="maxInMemorySize" value="1000"></property> -->
</bean>
<!-- 配置国际化资源文件路径 -->
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<!-- 定义消息资源文件的相对路径 -->
<value>messages/message</value>
</property>
</bean>
<!-- 基于Cookie的本地化解析器 -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieMaxAge" value="604800"/>
<property name="defaultLocale" value="zh_CN"/>
<property name="cookieName" value="Language"></property>
</bean>
</beans>