ResourceResolver that delegates to the chain to locate a resource and then
attempts to find a matching versioned resource contained in a WebJar JAR file.
This allows WebJars.org users to write version agnostic paths in their templates,
like <script src="/webjars/jquery/jquery.min.js"/>.
This path will be resolved to the unique version <script src="/webjars/jquery/1.2.0/jquery.min.js"/>,
which is a better fit for HTTP caching and version management in applications.
This also resolves resources for version agnostic HTTP requests "GET /jquery/jquery.min.js".
This resolver requires the org.webjars:webjars-locator-core library
on the classpath and is automatically registered if that library is present.
Be aware that WebJarAssetLocator constructor performs a classpath scanning that
could slow down application startup.
| Modifier and Type | Field and Description |
|---|---|
| private final WebJarAssetLocator | |
| private static final String | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | WebJarsResourceResolver()
Create a |
| public | WebJarsResourceResolver(WebJarAssetLocator webJarAssetLocator)
Create a |
| Modifier and Type | Method and Description |
|---|---|
| protected String | |
| protected Mono | resolveResourceInternal(ServerWebExchange exchange, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
Implements abstract org.
|
| protected Mono | resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)
Implements abstract org.
|
| webJarAssetLocator | back to summary |
|---|---|
| private final WebJarAssetLocator webJarAssetLocator | |
| WEBJARS_LOCATION | back to summary |
|---|---|
| private static final String WEBJARS_LOCATION | |
| WEBJARS_LOCATION_LENGTH | back to summary |
|---|---|
| private static final int WEBJARS_LOCATION_LENGTH | |
| WebJarsResourceResolver | back to summary |
|---|---|
| public WebJarsResourceResolver() Create a | |
| WebJarsResourceResolver | back to summary |
|---|---|
| public WebJarsResourceResolver(WebJarAssetLocator webJarAssetLocator) Create a | |
| findWebJarResourcePath | back to summary |
|---|---|
protected String findWebJarResourcePath(String path)
| |
| resolveResourceInternal | back to summary |
|---|---|
| protected Mono Implements abstract org.
| |
| resolveUrlPathInternal | back to summary |
|---|---|
| protected Mono Implements abstract org.
| |