Package org.springframework.web.reactive.resource
@NullMarked
package org.springframework.web.reactive.resource
Support classes for serving static resources.
-
ClassDescriptionAbstract base class for filename suffix based
VersionStrategy
implementations, for example, "static/myresource-version.js".Abstract base class forVersionStrategy
implementations that insert a prefix into the URL path, for example, "version/static/myresource.js".BaseResourceResolver
providing consistent logging.AResourceResolver
that resolves resources from aCache
or otherwise delegates to the resolver chain and caches the result.AResourceTransformer
that checks aCache
to see if a previously transformed resource exists in the cache and returns it if found, or otherwise delegates to the resolver chain and caches the result.AVersionStrategy
that calculates a Hex MD5 hash from the content of the resource and appends it to the file name, for example,"styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"
.AResourceTransformer
implementation that modifies links in a CSS file to match the public URL paths that should be exposed to clients (for example, with an MD5 content-based hash inserted in the URL).Abstract base class forCssLinkResourceTransformer.LinkParser
implementations.Extract content chunks that represent links.Resolver that delegates to the chain, and if a resource is found, it then attempts to find an encoded (for example, gzip, brotli) variant that is acceptable based on the "Accept-Encoding" request header.AVersionStrategy
that relies on a fixed version applied as a request path prefix, for example, reduced SHA, version name, release date, etc.Extended interface for aResource
to be written to an HTTP response.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.Raised whenResourceWebHandler
is mapped to the request but can not find a matching resource.A simpleResourceResolver
that tries to find a resource under the given locations matching to the request path.Resource handling utility methods to share common logic betweenResourceWebHandler
andorg.springframework.web.reactive.function.server
.A strategy for resolving a request to a server-side resource.A contract for invoking a chain ofResourceResolvers
where each resolver is given a reference to the chain allowing it to delegate when necessary.An abstraction for transforming the content of a resource.A contract for invoking a chain ofResourceTransformers
where each resolver is given a reference to the chain allowing it to delegate when necessary.A base class for aResourceTransformer
with an optional helper method for resolving public links within a transformed resource.A central component to use to obtain the public URL path that clients should use to access a static resource.HttpRequestHandler
that serves static resources in an optimized way according to the guidelines of Page Speed, YSlow, etc.An extension ofByteArrayResource
that aResourceTransformer
can use to represent an original resource preserving all other information except the content.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 (for example, 1 year) and cached until the version, and therefore the URL, is changed.A strategy to determine the version of a static resource and to apply and/or extract it from the URL path.