posts - 495,comments - 227,trackbacks - 0
原文地址:http://www.cnblogs.com/liukemng/p/3750117.html

用Spring做国际化时经常会报:
org.springframework.context.NoS hMessageException: No message found under code 'title' for locale 'zh_CN'. 这样的错误。请注意以下几点:
①新建资源文件时,尽量右击项目新建文件,来增加.
② 属性文件名的写法:
           messages_zh_CN.properties  (中文)            messages_en_US.properties  (英文)
③ 配置messageSource这个bean(注意:一定是messageSource不是messageResource ,这是Spring规定的)例如:
<beanid="messageSource"class="org.springframework.context.support.ResourceBundleMessageSource">   <propertyname="basename">   
<val>messages</val>
</property>
</bean>
 

posted on 2015-03-26 16:08 SIMONE 阅读(573) 评论(0)  编辑  收藏 所属分类: JAVA

只有注册用户登录后才能发表评论。


网站导航: