【发布时间】:2011-06-20 15:30:17
【问题描述】:
我在使用 Spring 设置国际化时遇到问题。 这是我的配置。
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="localization" />
</bean>
<!-- declare the resolver -->
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="sv" />
</bean>
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
</mvc:interceptors>
<mvc:annotation-driven />
即使我向?locale=sv(瑞典语)提出请求,它也总是向我显示英语。
我正在使用带有 Velocity 的 Spring。
有什么想法吗? 谢谢
【问题讨论】:
标签: spring internationalization locale interceptor