1. 22 3月, 2019 1 次提交
  2. 23 5月, 2018 1 次提交
  3. 07 1月, 2017 1 次提交
  4. 11 10月, 2016 1 次提交
    • B
      Resolve absolute resource links in ResourceTransformers · 679b661e
      Brian Clozel 提交于
      Prior to this commit, `ResourceTransformer` implementations would
      resolve internal links to other resources: both relative and absolute
      request paths.
      For relative request paths, those transformers would call
      `ResourceTransformerSupport.resolveUrlPath` with the resource path,
      as provided in the original file. This can cause problems when a
      `CachingResourceResolver` is configured in the resolver chain, because
      this resolver is caching resources, deriving the cache key from the
      given resource path — this can cause collisions for cases like this:
      
          resources/
          |--foo/
          |  |--foo.css (imports style.css)
          |  |--style.css
          |--bar/
          |  |--bar.css (imports style.css)
          |  |--style.css
      
      The first "style.css" resolved resource is then cached and will be given
      to any request asking for "style.css".
      
      To avoid those issues, this commit improves the `ResourceTransformer`
      implementations to calculate the absolute request path before asking the
      chain to resolve the resource URL, thus avoiding duplications.
      The resource chain will be then asked to resolve "/foo/style/css" or
      "/bar/style.css".
      
      Issue: SPR-14597
      679b661e
  5. 10 9月, 2016 1 次提交
    • B
      Change default appcache manifest file extension · 1881aa5b
      Brian Clozel 提交于
      This commit changes the default file extension configured with
      `AppCacheManifestTranformer`. This ResourceTransformer was previously
      considering `.manifest` files by default, but this has been changed in
      the official spec to `appcache`, in order not to clash with Microsoft's
      unregistered application/manifest type.
      
      Issue: SPR-14687
      1881aa5b
  6. 11 11月, 2014 1 次提交
  7. 21 10月, 2014 1 次提交
  8. 29 8月, 2014 1 次提交
    • B
      Update resource handler XML Namespace · d9f4016c
      Brian Clozel 提交于
      This change introduces a new <mvc:resource-chain/> tag that mirrors
      the ResourceChainRegistration java config counterpart.
      
      Resolvers and Transformers can be registered with bean/ref tags, and
      specific tags have been created for <mvc:version-resovlver> and
      <mvc:resource-cache> in order to make common configurations easier.
      
      Note that a specific "auto-configuration" attribute on the
      resource-chain allows to completely disable default registration of
      Resolvers and Transformers (sane defaults considered by the Framework).
      
        <mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/">
            <mvc:resource-chain>
              <mvc:resource-cache cache="resourceCache"/>
              <mvc:resolvers>
                <mvc:version-resolver>
                  <mvc:fixed-version-strategy version="abc" patterns="/**/*.js"/>
                  <mvc:content-version-strategy patterns="/**"/>
                </mvc:version-resolver>
              </mvc:resolvers>
              <mvc:transformers>
                <bean class="org.springframework.web.servlet.resource.AppCacheManifestTransformer"/>
              </mvc:transformers>
            </mvc:resource-chain>
        </mvc:resources>
      
      This also fixes a typo in the class name of
      AppCacheManifestResourceTransfo*r*mer.
      
      Issue: SPR-12129
      d9f4016c
  9. 12 8月, 2014 1 次提交
  10. 29 7月, 2014 1 次提交
  11. 11 7月, 2014 1 次提交
    • B
      Rename AppCacheResourceTransformer · bf7dac5f
      Brian Clozel 提交于
      This change renames AppCacheResourceTransformer to
      AppCacheManifestTransfomer, in order to avoid confusion between this
      transformer and the CacheResourceTransformer (which caches
      transformations done by the chain to save CPU/memory at runtime).
      
      Issue: SPR-11964
      bf7dac5f
  12. 10 7月, 2014 1 次提交
    • B
      Add AppCacheResourceTransformer · f11815c9
      Brian Clozel 提交于
      This change adds a new ResourceTransformer that helps handling resources
      within HTML5 AppCache manifests for HTML5 offline application.
      
      This transformer:
      * modifies links to match the public URL paths
      * appends a comment in the manifest, containing a Hash (e.g. "# Hash:
      9de0f09ed7caf84e885f1f0f11c7e326")
      
      See http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline
      for more details on HTML5 offline apps and appcache manifests.
      
      Here is a WebConfig example:
      
        @Override
        public void addResourceHandlers(ResourceHandlerRegistry registry) {
      
          AppCacheResourceTransformer appCacheTransformer =
                new AppCacheResourceTransformer();
      
            registry.addResourceHandler("/**")
                .addResourceLocations("classpath:static/")
                .setResourceResolvers(...)
                .setResourceTransformers(..., appCacheTransformer);
        }
      
      Issue: SPR-11964
      f11815c9