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

public Interface ResourceResolverChain

Known Direct Implementers
org.springframework.web.servlet.resource.DefaultResourceResolverChain
Imports
java.util.List, jakarta.servlet.http.HttpServletRequest, org.springframework.core.io.Resource, org.springframework.lang.Nullable

A contract for invoking a chain of ResourceResolvers where each resolver is given a reference to the chain allowing it to delegate when necessary.
Authors
Jeremy Grelle, Rossen Stoyanchev, Sam Brannen
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public Resource

Returns:

the resolved resource, or null if unresolved
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
)

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

public String

Returns:

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

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

Method Detail

resolveResourceback to summary
public Resource resolveResource(HttpServletRequest request, String requestPath, List<? extends Resource> locations)

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
@Nullable
resolveUrlPathback to summary
public String resolveUrlPath(String resourcePath, List<? extends Resource> locations)

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
@Nullable