Skip to content

Commit

Permalink
Document ResourceBundle limitations
Browse files Browse the repository at this point in the history
This commit adds a note to the documentation saying that ResourceBundle
does not support multiple bundles with the same base name.

Closes spring-projectsgh-27038
  • Loading branch information
poutsma authored and lxbzmy committed Mar 26, 2022
1 parent 28e1749 commit d1f2646
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/docs/asciidoc/core/core-beans.adoc
Expand Up @@ -10406,6 +10406,10 @@ You can also use the `MessageSourceAware` interface to acquire a reference to an
`ApplicationContext` that implements the `MessageSourceAware` interface is injected with
the application context's `MessageSource` when the bean is created and configured.

NOTE: Because Spring's `MessageSource` is based on Java's `ResourceBundle`, it does not merge
bundles with the same base name, but will only use the first bundle found.
Subsequent message bundles with the same base name are ignored.

NOTE: As an alternative to `ResourceBundleMessageSource`, Spring provides a
`ReloadableResourceBundleMessageSource` class. This variant supports the same bundle
file format but is more flexible than the standard JDK based
Expand Down

0 comments on commit d1f2646

Please sign in to comment.