您好,欢迎来到纷纭教育。
搜索
您的当前位置:首页spring ----> ResourceBundle [message] not found for MessageSource: Can't find bundle for base name m...

spring ----> ResourceBundle [message] not found for MessageSource: Can't find bundle for base name m...

来源:纷纭教育

环境:

idea 2018.1.3社区版,jdk8,spring4.2.0,maven3.5.2

主题:

spring国际化

出现的问题:

ResourceBundle [message] not found for MessageSource: Can't find bundle for base name message, local_zh

解决:

参考解决方法 

使用 org.springframework.context.support.ResourceBundleMessageSource 配置会导致以上问题出现。

改用 org.springframework.context.support.ReloadableResourceBundleMessageSource。

放置资源文件:

xml文件配置如下:

 相关帖子:

一个小发现:

导致使用配置 org.springframework.context.support.ResourceBundleMessageSource 国际化失败貌似是因为jsp不认识spring的spring标签库:spring.tld标签库,而对于spring-form.tld标签库是认识的。

当使用spring-form.tld标签库时,国际化文件可以放置在类根路径下,而且可以使用org.springframework.context.support.ResourceBundleMessageSource

配置国际化

备注:

有时间用thymeleaf或者FreeMarker试试

转载于:https://www.cnblogs.com/mrray1105/p/9068717.html

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- fenyunshixun.cn 版权所有 湘ICP备2023022495号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务