环境:

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

解决:

参考解决方法 https://stackoverflow.com/questions/25121392/resourcebundle-not-found-for-messagesource

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

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

放置资源文件:

xml文件配置如下:

相关帖子:

https://stackoverflow.com/questions/11150869/resourcebundle-not-found-for-messagesource-when-placed-inside-a-folder

一个小发现:

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

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

配置国际化

备注:

有时间用thymeleaf或者FreeMarker试试

spring ----> ResourceBundle [message] not found for MessageSource: Can't find bundle for base name message, local_zh的更多相关文章

  1. Spring Cloud Gateway过滤器精确控制异常返回(实战,控制http返回码和message字段)

    欢迎访问我的GitHub 这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos 本篇概览 前文<Spring Cloud Gat ...

  2. Android Bundle、Handler和Message类介绍

    Bundle是一个载体,可以存放基本数据类型.对象等内容,相当于一辆汽车,可以装载很多东西,然后运到需要的地方,例如: Bundle mBundle=new Bundle(); mBundle.put ...

  3. [spring源码学习]八、IOC源码-messageSource

    一.代码实例 我们在第八章可以看到,spring的context在初始化的时候,会默认调用系统中的各种约定好的bean,其中第一个bean就是id为messageSource的bean,我们了解这应该 ...

  4. Spring boot国际化

    国际化主要是引入了MessageSource,我们简单看下如何使用,以及其原理. 1.1 设置资源文件 在 properties新建i18n目录 新建message文件: messages.prope ...

  5. Maven ResourceBundle.getBundle读取Properties异常MissingResourceException: Can't find bundlei解决方法

    参考:https://blog.csdn.net/thousa_ho/article/details/72817616 问题描述 ResourceBundle读取properties配置文件提示 Mi ...

  6. JSTL解析——007——fmt标签库02

    各位亲们,近期事情比较多,没更新,come on! 1.<fmt:bundle>/<fmt:message>/<fmt:param>资源国际化标签 java中使用R ...

  7. java学习笔记12--国际化

    java学习笔记12--国际化 国际化的操作就是指一个程序可以同时适应多门语言,即:如果现在程序者是中国人,则会以中文为显示文字,如果现在程序的使用者是英国人,则会以英语为显示的文字,也就是说可以通过 ...

  8. spring中MessageSource的配置使用方法3--ResourceBundleMessageSource【转】

    本文转载仅供自己学习收录,不做任何商业用途,如有需要请访问原地址:http://blog.csdn.net/qyf_5445/article/details/8124431 ApplicationCo ...

  9. spring boot 国际化MessageSource

    转自:https://blog.csdn.net/flowingflying/article/details/76358970 spring中ResourceBundleMessageSource的配 ...

随机推荐

  1. wait()和notify()的理解与使用

    void notify() Wakes up a single thread that is waiting on this object’s monitor. 译:唤醒在此对象监视器上等待的单个线程 ...

  2. Mac通过安装Go2Shell实现“在当前目录打开iTerm2”

    先上效果图: 1.从官网下载最新的版本,不要从苹果商店下载,因为苹果商店的版本比较旧,只支持Finders10.6~10.10,不支持最新的版本 http://zipzapmac.com/Go2She ...

  3. FJUT Home_W的拆分序列(DP)题解

    Problem Description Home 现在给你一个序列要求你将这个序列拆成恰好两个子序列.且使得两个子序列的抖动系数之和最大. 对于一个序列c1,c2,c3,……cm. 其抖动系数=|c1 ...

  4. UVA 10382 Watering Grass(区间覆盖,贪心)题解

    题意:有一块草坪,这块草坪长l 米,宽 w 米,草坪有一些喷头,每个喷头在横坐标为 p 处,每个喷头的纵坐标都是(w/2) ,并且喷头的洒水范围是一个以喷头为圆心,半径为 r 米的圆.每次最少需要打开 ...

  5. 今天的任务--git练习

    克隆远程仓库项目 从版本控制中选择git 填写地址和本地目录,test测试成功后点击clone 克隆完成回到主界面,点击open打开刚才克隆的项目 git操作 添加文件py1.html 打开命令行 新 ...

  6. Asp.net MVC 控制器ActionResult的例子

    ActionResult 父类型 ViewResult View() 多重载应用 PartialViewResult PartialView() 部分试图 New EmptyResult()  空 如 ...

  7. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'

    本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...

  8. markdown一些网站

    1.https://stackedit.io/editor 2.https://github.com/bioinformatist/LncPipeReporter 3.

  9. linux 校准时间方法

        Debian.Ubuntu 系统安装NTP校时包:    apt-get install ntpdate   CentOS系统安装NTP校时包:    yum install ntp   校时 ...

  10. Intellij Idea修改css文件即时更新生成效果

    用来Idea也有一段时间了,觉得还是有很多地方没有用到,今天遇到了一个问题,百度了解决方法,正好在这里做一个小记录 主要问题是我在idea的项目里面修改了css文件,然后运行web文件,发现并没有做到 ...