Top Description Fields Constructors Methods
org.springframework.web.servlet.resource

pack-priv Class DefaultResourceResolverChain

extends Object
implements ResourceResolverChain
Class Inheritance
All Implemented Interfaces
org.springframework.web.servlet.resource.ResourceResolverChain
Imports
java.util.ArrayList, .Collections, .List, .ListIterator, jakarta.servlet.http.HttpServletRequest, org.springframework.core.io.Resource, org.springframework.lang.Nullable, org.springframework.util.Assert

Default immutable implementation of ResourceResolverChain.
Author
Rossen Stoyanchev
Since
4.1

Field Summary

Modifier and TypeField and Description
private final ResourceResolverChain
private final ResourceResolver

Constructor Summary

AccessConstructor and Description
public
private

Method Summary

Modifier and TypeMethod and Description
private static DefaultResourceResolverChain
initChain(ArrayList<? extends ResourceResolver> resolvers)

public Resource
resolveResource(HttpServletRequest
the current request
request
,
String
the portion of the request path to use
requestPath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
)

Implements org.springframework.web.servlet.resource.ResourceResolverChain.resolveResource.

Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.

public String
resolveUrlPath(String
the internal resource path
resourcePath
,
List<? extends Resource>
the locations to search in when looking up resources
locations
)

Implements org.springframework.web.servlet.resource.ResourceResolverChain.resolveUrlPath.

Resolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextChainback to summary
private final ResourceResolverChain nextChain
Annotations
@Nullable
resolverback to summary
private final ResourceResolver resolver
Annotations
@Nullable

Constructor Detail

DefaultResourceResolverChainback to summary
public DefaultResourceResolverChain(List<? extends ResourceResolver> resolvers)
DefaultResourceResolverChainback to summary
private DefaultResourceResolverChain(ResourceResolver resolver, ResourceResolverChain chain)

Method Detail

initChainback to summary
private static DefaultResourceResolverChain initChain(ArrayList<? extends ResourceResolver> resolvers)
resolveResourceback to summary
public Resource resolveResource(HttpServletRequest request, String requestPath, List<? extends Resource> locations)

Implements org.springframework.web.servlet.resource.ResourceResolverChain.resolveResource.

Doc from org.springframework.web.servlet.resource.ResourceResolverChain.resolveResource.

Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.

Parameters
request:HttpServletRequest

the current request

requestPath:String

the portion of the request path to use

locations:List<? extends Resource>

the locations to search in when looking up resources

Returns:Resource

the resolved resource, or null if unresolved

Annotations
@Override
@Nullable
resolveUrlPathback to summary
public String resolveUrlPath(String resourcePath, List<? extends Resource> locations)

Implements org.springframework.web.servlet.resource.ResourceResolverChain.resolveUrlPath.

Doc from org.springframework.web.servlet.resource.ResourceResolverChain.resolveUrlPath.

Resolve 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.

Parameters
resourcePath:String

the internal resource path

locations:List<? extends Resource>

the locations to search in when looking up resources

Returns:String

the resolved public URL path, or null if unresolved

Annotations
@Override
@Nullable