类 CssLinkResourceTransformer
- java.lang.Object
- org.springframework.web.servlet.resource.ResourceTransformerSupport
- org.springframework.web.servlet.resource.CssLinkResourceTransformer
- 所有已实现的接口:
ResourceTransformer
public class CssLinkResourceTransformer extends ResourceTransformerSupport
AResourceTransformer
implementation that modifies links in a CSS file to match the public URL paths that should be exposed to clients (e.g. with an MD5 content-based hash inserted in the URL).The implementation looks for links in CSS
@import
statements and also inside CSSurl()
functions. All links are then passed through theResourceResolverChain
and resolved relative to the location of the containing CSS file. If successfully resolved, the link is modified, otherwise the original link is preserved.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
CssLinkResourceTransformer.AbstractCssLinkParser
protected static interface
CssLinkResourceTransformer.CssLinkParser
构造器概要
构造器 构造器 说明 CssLinkResourceTransformer()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Resource
transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain)
Transform the given resource.从类继承的方法 org.springframework.web.servlet.resource.ResourceTransformerSupport
getResourceUrlProvider, resolveUrlPath, setResourceUrlProvider
构造器详细资料
CssLinkResourceTransformer
public CssLinkResourceTransformer()
方法详细资料
transform
public Resource transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain) throws IOException
从接口复制的说明:ResourceTransformer
Transform the given resource.- 参数:
request
- the current requestresource
- the resource to transformtransformerChain
- the chain of remaining transformers to delegate to- 返回:
- the transformed resource (never
null
) - 抛出:
IOException
- if the transformation fails