diff --git a/spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java b/spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java index 397dcf159abe..80ec99ce02ec 100644 --- a/spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java +++ b/spring-web/src/main/java/org/springframework/web/util/WebUtilRuntimeHints.java @@ -18,6 +18,7 @@ import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; +import org.springframework.core.io.ClassPathResource; /** * {@link RuntimeHintsRegistrar} implementation that registers resource @@ -30,6 +31,7 @@ class WebUtilRuntimeHints implements RuntimeHintsRegistrar { @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { - hints.resources().registerPattern("org/springframework/web/util/HtmlCharacterEntityReferences.properties"); + hints.resources().registerResourceIfNecessary( + new ClassPathResource("HtmlCharacterEntityReferences.properties", getClass())); } }