- Mastering Spring 5.0
- Ranga Rao Karanam
- 59字
- 2025-04-04 19:05:29
Configure Spring MVC resource handler to deliver WebJar static content
This is very simple. We need to add the following mapping to the spring context:
<mvc:resources mapping="/webjars/**" location="/webjars/"/>
With this configuration, ResourceHttpRequestHandler makes the content from WebJars available as static content.
As discussed in the section on static content, we can specifically cache a period if we want to cache the content.