summaryrefslogtreecommitdiff
path: root/src/main/resources/spring-mvc.xml
diff options
context:
space:
mode:
authordell <[email protected]>2018-01-16 09:57:12 +0800
committerdell <[email protected]>2018-01-16 09:57:12 +0800
commitf45edaddb5409f978e4106fa5311fd63c1c4de0f (patch)
treedc1224927effcde35f8660ea2fa902a4e4adbe99 /src/main/resources/spring-mvc.xml
parent0597c974e85af7d92ad456af6d4ec889c647c75f (diff)
增加系统国际化配置HEADmaster
Diffstat (limited to 'src/main/resources/spring-mvc.xml')
-rw-r--r--src/main/resources/spring-mvc.xml16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml
index 2e961f65c..7b6391e49 100644
--- a/src/main/resources/spring-mvc.xml
+++ b/src/main/resources/spring-mvc.xml
@@ -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>