public abstract class ResourceTransformerSupport extends Object implements ResourceTransformer
ResourceTransformerwith an optional helper method for resolving public links within a transformed resource.
|Constructor and Description|
|Modifier and Type||Method and Description|
Return the configured
A transformer can use this method when a resource being transformed contains links to other resources.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void setResourceUrlProvider(ResourceUrlProvider resourceUrlProvider)
ResourceUrlProviderto use when resolving the public URL of links in a transformed resource (e.g. import links in a CSS file). This is required only for links expressed as full paths, i.e. including context and servlet path, and not for relative links.
By default this property is not set. In that case if a
ResourceUrlProvider is needed an attempt is made to find the
ResourceUrlProvider exposed through the
ResourceUrlProviderExposingInterceptor (configured by default in the MVC
Java config and XML namespace). Therefore explicitly configuring this
property should not be needed in most cases.
resourceUrlProvider- the URL provider to use
public ResourceUrlProvider getResourceUrlProvider()
protected String resolveUrlPath(String resourcePath, HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain)
resourcePath- the path to a resource that needs to be re-written
request- the current request
resource- the resource being transformed
transformerChain- the transformer chain