#1075 - Explicitly use classpath protocol for base names of MessageResolver resource bundles.

We now explicitly equip the resource bundle base name with a "classpath:" prefix so that the resource lookup also works in Boot web applications in which the ResourceLoader setup is tweaked to prefer ServletContext resources.
This commit is contained in:
Oliver Drotbohm
2019-09-26 16:54:08 +02:00
parent f15740fb25
commit 507f7de0c3
2 changed files with 51 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ public class HateoasConfiguration {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setResourceLoader(context);
messageSource.setBasename(I18N_BASE_NAME);
messageSource.setBasename("classpath:".concat(I18N_BASE_NAME));
messageSource.setDefaultEncoding(StandardCharsets.UTF_8.toString());
if (!candidates.isEmpty()) {