spring mvc i18n+freemarker

来源:互联网 发布:贵金属数据下载 编辑:程序博客网 时间:2024/06/06 02:00

1.spring 配置

新建 applicationContext-messages.xml

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<value>message/messages</value>   //路径 对应的properties名字 要这样 messages_zh_CN.properties
</property>
</bean>

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver">   //接收用户的系统对应的语言

2.properties编码工具

http://www.418log.org/tools/native2ascii.html

0 0
原创粉丝点击