java - 配置多个消息属性
问题描述
我有属性文件,我需要将它们都设置为加载,但我不知道如何使用多个属性执行此操作
resources
`-- messages.properties
`-- handle.properties
解决方案
使用@PropertySources
. 注释保存文件属性的配置类或您的Main
类。
例如:
@PropertySources(
{
@PropertySource("classpath:messages.properties"),
@PropertySource("classpath:handle.properties")
}
)
推荐阅读
- datetime - 如何在pyspark中将字符串转换为日期而不显示日期?
- python - Python - 无论如何都需要手动实例化?
- javascript - 使用 JQuery 使用 JSON API 响应
- google-maps - 将谷歌地图渲染到其他 ID
- javascript - 如何使用 Javascript 将一组幻灯片相互定位?
- python - Python typehint int 为正
- security - SSIS 包执行在代理作业中失败,在其他任何地方都没有失败,没有错误消息
- azure - Azure DevOps 和 GitHub 服务连接的最佳安全实践
- angular - 使用 .Net 堆栈在 Azure 应用服务上托管 Angular Universal 9
- android - 使用 StaggeredGridLayoutManager 防止图片移动