У меня проблема с несколькими языками в Spring на проекте EgovFramework.
Моя проблема не может изменить язык, когда я запрашиваю таким образом http://localhost:8080/common/cop/adb/selectAdbkList.do?language=en_us, должны быть изменены все метки и имякнопки на английский.
Вот мой код context-common.xml для сообщений файлов вызовов
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="language" />
</bean>
<!-- <bean id="localeResolver" -->
<!-- class="org.springframework.web.servlet.i18n.SessionLocaleResolver"
/> -->
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="ko_KR" />
</bean>
<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:egovframework/message/com/messages</value>
</list>
</property>
<property name="fallbackToSystemLocale" value="false" />
<property name="cacheSeconds" value="3" />
<property name="defaultEncoding" value="UTF-8" />
<property name="fileEncodings" value="UTF-8" />
</bean>
<!-- <bean id="messageSource" -->
<!-- class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> -->
<!-- <property name="basenames"> -->
<!-- <list> -->
<!-- <value>classpath:/egovframework/message/com/message-common -->
<!-- </value> -->
<!-- </list> -->
<!-- </property> -->
<!-- <property name="defaultEncoding" value="UTF-8" /> -->
<!-- <property name="cacheSeconds"> -->
<!-- <value>60</value> -->
<!-- </property> -->
<!-- </bean> -->
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<array>
<value>classpath:/egovframework/egovProps/globals.properties
</value>
<value>classpath:/egovframework/rte/fdl/property/messages/properties.properties
</value>
<value>classpath:/egovframework/rte/fdl/idgnr/messages/idgnr.properties
</value>
</array>
</property>
</bean>
<bean id="egovMessageSource" class="egovframework.com.cmm.EgovMessageSource">
<property name="reloadableResourceBundleMessageSource">
<ref bean="messageSource" />
</property>
</bean>
<!-- 실행환경에서 빈 이름 참조(AbstractServiceImpl) -->
<bean id="leaveaTrace" class="egovframework.rte.fdl.cmmn.trace.LeaveaTrace">
<property name="traceHandlerServices">
<list>
<ref bean="egov.traceHandlerService" />
</list>
</property>
</bean>
<bean id="egov.traceHandlerService"
class="egovframework.rte.fdl.cmmn.trace.manager.DefaultTraceHandleManager">
<property name="reqExpMatcher">
<ref bean="egov.antPathMater" />
</property>
<property name="patterns">
<list>
<value>*</value>
</list>
</property>
<property name="handlers">
<list>
<ref bean="egov.defaultTraceHandler" />
</list>
</property>
</bean>
<bean id="egov.antPathMater" class="org.springframework.util.AntPathMatcher" />
<bean id="egov.defaultTraceHandler"
class="egovframework.rte.fdl.cmmn.trace.handler.DefaultTraceHandler" />
<!-- MULTIPART RESOLVERS -->
<!-- regular spring resolver -->
<bean id="spring.RegularCommonsMultipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="100000000" />
<property name="maxInMemorySize" value="100000000" />
</bean>
<!-- custom multi file resolver -->
<bean id="local.MultiCommonsMultipartResolver" class="egovframework.com.cmm.web.EgovMultipartResolver">
<property name="maxUploadSize" value="100000000" />
<property name="maxInMemorySize" value="100000000" />
</bean>
<!-- choose one from above and alias it to the name Spring expects -->
<!-- alias name="local.MultiCommonsMultipartResolver" alias="multipartResolver"
/ -->
<alias name="spring.RegularCommonsMultipartResolver" alias="multipartResolver" />
<context:component-scan base-package="egovframework, example">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Service" />
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Repository" />
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
Вот путь к классу всех файлов сообщений.
- egovframework.message.com
- messages_en_US.properties
- messages_ko_KR.properties
Пожалуйста, помогите мне, почемуЯ не могу измениться при запросе? Language = en_us в браузере .....
Спасибо