类 ResourceTransformerSupport

    • 方法详细资料

      • resolveUrlPath

        @Nullable
        protected String resolveUrlPath​(String resourcePath,
                                        HttpServletRequest request,
                                        Resource resource,
                                        ResourceTransformerChain transformerChain)
        A transformer can use this method when a resource being transformed contains links to other resources. Such links need to be replaced with the public facing link as determined by the resource resolver chain (e.g. the public URL may have a version inserted).
        参数:
        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
        返回:
        the resolved URL, or if not resolvable
      • toAbsolutePath

        protected String toAbsolutePath​(String path,
                                        HttpServletRequest request)
        Transform the given relative request path to an absolute path, taking the path of the given request as a point of reference. The resulting path is also cleaned from sequences like "path/..".
        参数:
        path - the relative path to transform
        request - the referer request
        返回:
        the absolute request path for the given resource path