spring - Spring ResourceBundleMessageSource 多个属性文件配置在 spring xml 文件中?
问题描述
例如,我有两个属性文件,如消息和查询。如何在spring xml中配置
解决方案
Well, you could use the below code snippet.
<context:property-placeholder
location="classpath:dao.properties,
classpath:services.properties,
classpath:user.properties"
ignore-unresolvable="true"/>
- In this, the order attribute needs to be specified to fix the order in which these are processed by Spring.
- All property placeholders minus the last one (highest order) should have
ignore-unresolvable="true"
to allow the resolution mechanism to pass to others in the context without throwing an exception
推荐阅读
- git - Git合并了基本相同的不同存储库
- python - 我想列出特定文件夹中的目录,但我希望它们在名称前列出一个数字
- javascript - 在 shown.bs.tab 事件中无法获取上一个活动选项卡
- arrays - 无法将 const 分配给状态值,返回未定义
- bash - 用于安装 aws cli、java 的 shell 脚本,
- c# - 如何通过 LINQ 从 DB 中计数以及在哪里
- java - 在java中创建单链表后如何回到单链表的头部?
- node.js - 使用 Electron 编译 node.js 版本时出现问题
- r - 将 top_n 函数映射到分组数据
- android - onRequestPermissionResult 的 grantList 为空