环境:

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. Codeforces Round #483 (Div. 2)题解

    A. Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...

  2. Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals) Problem C (Codeforces 828C) - 链表 - 并查集

    Ivan had string s consisting of small English letters. However, his friend Julia decided to make fun ...

  3. 【python--函数解读】

    1.strip()函数:用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列(包括'\n', '\r',  '\t',  ' ') 注意: 该方法只能删除开头或是结尾的字符,不能删除中间部分的 ...

  4. Android.bp 添加宏开关【转】

    本文转载自:https://github.com/zzb2760715357/document/blob/master/android_doc/Android.bp%E6%B7%BB%E5%8A%A0 ...

  5. P4137 Rmq Problem / mex

    目录 链接 思路 线段树 莫队 链接 https://www.luogu.org/problemnew/show/P4137 思路 做了好几次,每次都得想一会,再记录一下 可持久化权值线段树 区间出现 ...

  6. codevs1048石子归并

    codevs1048 石子归并  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 传送门  http://codevs.cn/problem/1048/ 题目描述 ...

  7. Paper Reading: Perceptual Generative Adversarial Networks for Small Object Detection

    Perceptual Generative Adversarial Networks for Small Object Detection 2017-07-11  19:47:46   CVPR 20 ...

  8. (zhuan) Paper Collection of Multi-Agent Reinforcement Learning (MARL)

    this blog from: https://github.com/LantaoYu/MARL-Papers Paper Collection of Multi-Agent Reinforcemen ...

  9. 在 2016 年学 JavaScript 是一种什么样的体验?(React从入门到放弃)

    jquery 年代 vs 前端模块化 http://blog.csdn.net/offbye/article/details/52793921 ++ 嘿,我最近接到一个 Web 项目,不过老实说,我这 ...

  10. 给大家讲个故事,感受一下什么叫CF。不知道的请认真听。

    我朋友是个温柔.体贴.负责.做事认真和口才流利的好男人 他在大一时喜欢上别系的女同学,像他这样的好人我以为这段恋情是手到擒来 但并没有,女方只把它当工具人,一当就当了四年 身为室友的我每天看著她为女方 ...