@ -1,5 +1,5 @@
/ *
/ *
* Copyright 2002 - 2015 the original author or authors .
* Copyright 2002 - 2017 the original author or authors .
*
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
* you may not use this file except in compliance with the License .
@ -38,15 +38,8 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
/ * *
/ * *
* Configure a { @link ResourceUrlProvider } to use when resolving the public
* Configure a { @link ResourceUrlProvider } to use when resolving the public
* URL of links in a transformed resource ( e . g . import links in a CSS file ) .
* 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
* This is required only for links expressed as full paths and not for
* context and servlet path , and not for relative links .
* relative links .
* < p > By default this property is not set . In that case if a
* { @code ResourceUrlProvider } is needed an attempt is made to find the
* { @code ResourceUrlProvider } exposed through the
* { @link org . springframework . web . servlet . resource . ResourceUrlProviderExposingInterceptor
* ResourceUrlProviderExposingInterceptor } ( configured by default in the MVC
* Java config and XML namespace ) . Therefore explicitly configuring this
* property should not be needed in most cases .
* @param resourceUrlProvider the URL provider to use
* @param resourceUrlProvider the URL provider to use
* /
* /
public void setResourceUrlProvider ( ResourceUrlProvider resourceUrlProvider ) {
public void setResourceUrlProvider ( ResourceUrlProvider resourceUrlProvider ) {
@ -96,7 +89,7 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
* @return the absolute request path for the given resource path
* @return the absolute request path for the given resource path
* /
* /
protected String toAbsolutePath ( String path , HttpServletRequest request ) {
protected String toAbsolutePath ( String path , HttpServletRequest request ) {
String requestPath = this . getResourceUrlProvider ( ) . getUrlPathHelper ( ) . getRequestUri ( request ) ;
String requestPath = this . findResourceUrlProvider ( request ) . getUrlPathHelper ( ) . getRequestUri ( request ) ;
String absolutePath = StringUtils . applyRelativePath ( requestPath , path ) ;
String absolutePath = StringUtils . applyRelativePath ( requestPath , path ) ;
return StringUtils . cleanPath ( absolutePath ) ;
return StringUtils . cleanPath ( absolutePath ) ;
}
}