纷纭教育
您的当前位置:首页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

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