diff options
Diffstat (limited to 'src/main/resources/spring-mvc.xml')
| -rw-r--r-- | src/main/resources/spring-mvc.xml | 16 |
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> |
