类 WebJarsResourceResolver
java.lang.Object
cn.taketoday.web.resource.AbstractResourceResolver
cn.taketoday.web.resource.WebJarsResourceResolver
- 所有已实现的接口:
ResourceResolver
A
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="/jquery/jquery.min.js"/>.
This path will be resolved to the unique version <script src="/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.
- 从以下版本开始:
- 4.0
- 作者:
- Brian Clozel
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private final org.webjars.WebJarAssetLocatorprivate static final Stringprivate static final int从类继承的字段 cn.taketoday.web.resource.AbstractResourceResolver
logger -
构造器概要
构造器构造器说明Create aWebJarsResourceResolverwith a defaultWebJarAssetLocatorinstance.WebJarsResourceResolver(org.webjars.WebJarAssetLocator webJarAssetLocator) Create aWebJarsResourceResolverwith a customWebJarAssetLocatorinstance, e.g. with a custom index. -
方法概要
修饰符和类型方法说明protected StringfindWebJarResourcePath(String path) protected cn.taketoday.core.io.ResourceresolveResourceInternal(RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) protected StringresolveUrlPathInternal(String resourceUrlPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) 从类继承的方法 cn.taketoday.web.resource.AbstractResourceResolver
resolveResource, resolveUrlPath
-
字段详细资料
-
WEBJARS_LOCATION
- 另请参阅:
-
WEBJARS_LOCATION_LENGTH
private static final int WEBJARS_LOCATION_LENGTH -
webJarAssetLocator
private final org.webjars.WebJarAssetLocator webJarAssetLocator
-
-
构造器详细资料
-
WebJarsResourceResolver
public WebJarsResourceResolver()Create aWebJarsResourceResolverwith a defaultWebJarAssetLocatorinstance. -
WebJarsResourceResolver
public WebJarsResourceResolver(org.webjars.WebJarAssetLocator webJarAssetLocator) Create aWebJarsResourceResolverwith a customWebJarAssetLocatorinstance, e.g. with a custom index.
-
-
方法详细资料
-
resolveResourceInternal
protected cn.taketoday.core.io.Resource resolveResourceInternal(@Nullable RequestContext request, String requestPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) -
resolveUrlPathInternal
protected String resolveUrlPathInternal(String resourceUrlPath, List<? extends cn.taketoday.core.io.Resource> locations, ResourceResolvingChain chain) -
findWebJarResourcePath
-