Skip to content

Commit e72b821

Browse files
committed
Mention WebJarsResourceResolver in ref doc
Issue: SPR-12323
1 parent 89cc8e0 commit e72b821

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/asciidoc/web-mvc.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5026,7 +5026,12 @@ the response `encodeURL` method. Alternatively, an application can also inject a
50265026
use directly the `ResourceUrlProvider` bean, which is automatically declared with the MVC
50275027
Java config and the MVC namespace.
50285028

5029-
5029+
Webjars are also supported with `WebJarsResourceResolver`, which is automatically registered
5030+
when the ``"org.webjars:webjars-locator"` library is on classpath. This resolver allows
5031+
the resource chain to resolve version agnostic libraries from HTTP GET requests
5032+
`"GET /jquery/jquery.min.js" will return resource "/jquery/1.2.0/jquery.min.js"`.
5033+
It also works by rewriting resource URLs in templates
5034+
`<script src="/jquery/jquery.min.js"/> -> <script src="/jquery/1.2.0/jquery.min.js"/>`.
50305035

50315036

50325037
[[mvc-default-servlet-handler]]

0 commit comments

Comments
 (0)