Class AbstractResourceResolver
java.lang.Object
org.springframework.web.servlet.resource.AbstractResourceResolver
- All Implemented Interfaces:
- ResourceResolver
- Direct Known Subclasses:
- CachingResourceResolver,- EncodedResourceResolver,- LiteWebJarsResourceResolver,- PathResourceResolver,- VersionResourceResolver,- WebJarsResourceResolver
Base class for 
ResourceResolver
 implementations. Provides consistent logging.- Since:
- 4.1
- Author:
- Rossen Stoyanchev
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionresolveResource(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) resolveUrlPath(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) 
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
AbstractResourceResolverpublic AbstractResourceResolver()
 
- 
- 
Method Details- 
resolveResource@Nullable public Resource resolveResource(@Nullable HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain) Description copied from interface:ResourceResolverResolve the supplied request and request path to aResourcethat exists under one of the given resource locations.- Specified by:
- resolveResourcein interface- ResourceResolver
- Parameters:
- request- the current request (may not be present in some calls)
- requestPath- the portion of the request path to use
- locations- the locations to search in when looking up resources
- chain- the chain of remaining resolvers to delegate to
- Returns:
- the resolved resource, or nullif unresolved
 
- 
resolveUrlPath@Nullable public String resolveUrlPath(String resourceUrlPath, List<? extends Resource> locations, ResourceResolverChain chain) Description copied from interface: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. - Specified by:
- resolveUrlPathin interface- ResourceResolver
- Parameters:
- resourceUrlPath- the internal resource path
- locations- the locations to search in when looking up resources
- chain- the chain of resolvers to delegate to
- Returns:
- the resolved public URL path, or nullif unresolved
 
- 
resolveResourceInternal@Nullable protected abstract Resource resolveResourceInternal(@Nullable HttpServletRequest request, String requestPath, List<? extends Resource> locations, ResourceResolverChain chain) 
- 
resolveUrlPathInternal
 
-