接口的使用
org.springframework.web.servlet.resource.ResourceResolver
使用ResourceResolver的程序包 程序包 说明 org.springframework.web.servlet.config.annotation Annotation-based setup for Spring MVC.org.springframework.web.servlet.resource Support classes for serving static resources.org.springframework.web.servlet.config.annotation中ResourceResolver的使用
返回变量类型为ResourceResolver的类型的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 protected List<ResourceResolver>
ResourceChainRegistration. getResourceResolvers()
参数类型为ResourceResolver的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 ResourceChainRegistration
ResourceChainRegistration. addResolver(ResourceResolver resolver)
Add a resource resolver to the chain.org.springframework.web.servlet.resource中ResourceResolver的使用
实现ResourceResolver的org.springframework.web.servlet.resource中的类 修饰符和类型 类 说明 class
AbstractResourceResolver
Base class forResourceResolver
implementations.class
CachingResourceResolver
AResourceResolver
that resolves resources from aCache
or otherwise delegates to the resolver chain and saves the result in the cache.class
EncodedResourceResolver
Resolver that delegates to the chain, and if a resource is found, it then attempts to find an encoded (e.g. gzip, brotli) variant that is acceptable based on the "Accept-Encoding" request header.class
GzipResourceResolver
已过时。as of 5.1, in favor of usingEncodedResourceResolver
class
PathResourceResolver
A simpleResourceResolver
that tries to find a resource under the given locations matching to the request path.class
VersionResourceResolver
Resolves request paths containing a version string that can be used as part of an HTTP caching strategy in which a resource is cached with a date in the distant future (e.g. 1 year) and cached until the version, and therefore the URL, is changed.class
WebJarsResourceResolver
AResourceResolver
that delegates to the chain to locate a resource and then attempts to find a matching versioned resource contained in a WebJar JAR file.返回变量类型为ResourceResolver的类型的org.springframework.web.servlet.resource中的方法 修饰符和类型 方法 说明 List<ResourceResolver>
ResourceHttpRequestHandler. getResourceResolvers()
Return the list of configured resource resolvers.类型变量类型为ResourceResolver的org.springframework.web.servlet.resource中的方法参数 修饰符和类型 方法 说明 void
ResourceHttpRequestHandler. setResourceResolvers(List<ResourceResolver> resourceResolvers)
Configure the list ofResourceResolvers
to use.