PropertyPlaceholderConfigurer 与 ReloadableResourceBundleMessageSource

Aru*_*run 5 properties-file spring-3

在 Google 上搜索如何在 Spring 3 中配置属性文件,我得到了许多不同的答案。我发现,ReloadableResourceBundleMessageSourcePropertyPlaceholderConfigurer可用于从属性文件获取的属性。有人可以解释一下这些之间的区别吗?

Aru*_*run 2

属性占位符配置器

当我们需要加载一些属性文件时使用PropertyPlaceholderConfigurer,这些属性文件的属性在spring的applicationcontext.xml中使用。我们可以直接使用 JSTL 表达式来使用这些属性。

ReloadableResourceBundleMessageSource

ReloadableResourceBundleMessageSource当我们需要使用applicationcontext.xml之外的属性文件时我们使用。使用 ReloadableResourceBundleMessageSource 加载的属性在 applicationcontext.xml 中不可访问