2014-03-26 36 views
2

有人可以向我解釋PropertyPlaceholderConfigurer和ResourceBundleMessageSource之間的區別嗎?何時使用第一個和何時使用後者?PropertyPlaceholderConfigurer和ResourceBundleMessageSource

+0

[PropertyPlaceholderConfigurer VS reloadableresourcebundlemessagesource]的可能重複(http://stackoverflow.com/questions/20759737/propertyplaceholderconfigurer-vs-reloadableresourcebundlemessagesource) – Jabir

回答

-1

here

PropertyPlaceholderConfigurer

我們使用PropertyPlaceholderConfigurer當我們需要加載一些 propertyfiles wose屬性在applicationContext.xml中 春天的使用。我們可以直接使用JSTL表達式來使用這些屬性。 reloadableresourcebundlemessagesource

當我們需要在applicationcontext.xml之外使用 屬性文件時,我們使用reloadableresourcebundlemessagesource。使用reloadableresourcebundlemessagesource裝載屬性 是不可訪問 在用於屬性的applicationContext.xml

+0

@Downvoter請添加一些評論,使得其可用於未來的讀者 – Jabir

+0

也許他(她)以這種方式投票,因爲那篇文章談論'ReloadableResourceBundleMessageSource'和這個關於'ResourceBundleMessageSource'的文章。 –

1

PropertyPlaceholderConfigurer文件在應用程序上下文或與@value代碼內使用。

用於國際化的ResourceBundleMessageSource &要在用戶,jsp直接或通過在組件內部連接消息資源bean顯示給用戶的消息的本地化(i18n)。

相關問題