Skip to content

Commit a315abf

Browse files
committed
Polish ResourcePatternResolver docuementation in the reference manual
See gh-26447
1 parent 36d133c commit a315abf

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

+15-2
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,18 @@ contain multiple files with the same path and the same name. See
460460
on wildcard support with the `classpath*:` resource prefix.
461461

462462
A passed-in `ResourceLoader` (for example, one supplied via
463-
<<resources-resourceloaderaware, `ResourceLoaderAware`>> semantics can be checked whether
463+
<<resources-resourceloaderaware,`ResourceLoaderAware`>> semantics) can be checked whether
464464
it implements this extended interface too.
465465

466466
`PathMatchingResourcePatternResolver` is a standalone implementation that is usable
467467
outside an `ApplicationContext` and is also used by `ResourceArrayPropertyEditor` for
468-
populating `Resource[]` bean properties.
468+
populating `Resource[]` bean properties. `PathMatchingResourcePatternResolver` is able to
469+
resolve a specified resource location path into one or more matching `Resource` objects.
470+
The source path may be a simple path which has a one-to-one mapping to a target
471+
`Resource`, or alternatively may contain the special `classpath*:` prefix and/or internal
472+
Ant-style regular expressions (matched using Spring's
473+
`org.springframework.util.AntPathMatcher` utility). Both of the latter are effectively
474+
wildcards.
469475

470476
[NOTE]
471477
====
@@ -477,6 +483,8 @@ implements the `ResourcePatternResolver` interface and delegates to the default
477483
====
478484

479485

486+
487+
480488
[[resources-resourceloaderaware]]
481489
== The `ResourceLoaderAware` Interface
482490

@@ -525,6 +533,11 @@ constructor argument, or method parameter that expects the `ResourceLoader` type
525533
as the field, constructor, or method in question carries the `@Autowired` annotation.
526534
For more information, see <<beans-autowired-annotation>>.
527535

536+
NOTE: To load one or more `Resource` objects for a resource path that contains wildcards
537+
or makes use of the special `classpath*:` resource prefix, consider having an instance of
538+
<<resources-resourcepatternresolver,`ResourcePatternResolver`>> autowired into your
539+
application components instead of `ResourceLoader`.
540+
528541

529542

530543

0 commit comments

Comments
 (0)