类 AbstractResourceResolver
- java.lang.Object
- org.springframework.web.servlet.resource.AbstractResourceResolver
- 所有已实现的接口:
ResourceResolver
- 直接已知子类:
CachingResourceResolver,GzipResourceResolver,PathResourceResolver,VersionResourceResolver,WebJarsResourceResolver
public abstract class AbstractResourceResolver extends Object implements ResourceResolver
Base class forResourceResolverimplementations. Provides consistent logging.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 AbstractResourceResolver()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 ResourceresolveResource(HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)Resolve the supplied request and request path to aResourcethat exists under one of the given resource locations.protected abstract ResourceresolveResourceInternal(HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)StringresolveUrlPath(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)Resolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.protected abstract StringresolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)
构造器详细资料
AbstractResourceResolver
public AbstractResourceResolver()
方法详细资料
resolveResource
public Resource resolveResource(HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
从接口复制的说明:ResourceResolverResolve the supplied request and request path to aResourcethat exists under one of the given resource locations.- 指定者:
resolveResource在接口中ResourceResolver- 参数:
request- the current requestrequestPath- the portion of the request path to uselocations- the locations to search in when looking up resourceschain- the chain of remaining resolvers to delegate to- 返回:
- the resolved resource or
nullif unresolved
resolveUrlPath
public String resolveUrlPath(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)
从接口复制的说明:ResourceResolverResolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.This is useful when rendering URL links to clients.
- 指定者:
resolveUrlPath在接口中ResourceResolver- 参数:
resourceUrlPath- the internal resource pathlocations- the locations to search in when looking up resourceschain- the chain of resolvers to delegate to- 返回:
- the resolved public URL path or
nullif unresolved
resolveResourceInternal
protected abstract Resource resolveResourceInternal(HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain)
resolveUrlPathInternal
protected abstract String resolveUrlPathInternal(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain)