- Mastering Spring 5.0
- Ranga Rao Karanam
- 59字
- 2021-07-02 22:12:21
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.