Skip to content

Commit bf27904

Browse files
committed
Document ResourceBundle limitations
This commit adds a note to the documentation saying that ResourceBundle does not support multiple bundles with the same base name. Closes gh-27038
1 parent 95d7f88 commit bf27904

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/docs/asciidoc/core/core-beans.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10406,6 +10406,10 @@ You can also use the `MessageSourceAware` interface to acquire a reference to an
1040610406
`ApplicationContext` that implements the `MessageSourceAware` interface is injected with
1040710407
the application context's `MessageSource` when the bean is created and configured.
1040810408

10409+
NOTE: Because Spring's `MessageSource` is based on Java's `ResourceBundle`, it does not merge
10410+
bundles with the same base name, but will only use the first bundle found.
10411+
Subsequent message bundles with the same base name are ignored.
10412+
1040910413
NOTE: As an alternative to `ResourceBundleMessageSource`, Spring provides a
1041010414
`ReloadableResourceBundleMessageSource` class. This variant supports the same bundle
1041110415
file format but is more flexible than the standard JDK based

0 commit comments

Comments
 (0)