1. 17 10月, 2014 3 次提交
    • R
      Cache lookup path in ResourceUrlEncodingFilter · 3d96c883
      Rossen Stoyanchev 提交于
      Commit https://github.com/spring-projects/spring-framework/commit/2b97d6
      introduced a change where the path within the DispatcherServlet is
      determined with each call to ResourceUrlProvider.getForRequestUrl.
      
      To avoid repeating that every time a URL is encoded through the
      response, we now cache the result of the lookupPath determination in
      ResourceUrlEncodingFilter.
      
      Issue: SPR-12332
      3d96c883
    • R
      Polish ResourceUrlEncodingFilter · f353a28f
      Rossen Stoyanchev 提交于
      f353a28f
    • R
      Avoid HandlerMapping attribute in ResourceUrlProvider · 97441d05
      Rossen Stoyanchev 提交于
      The use of the HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
      in ResourceUrlProvider (as a way of saving lookup path determination)
      leads to incorrect results. For example when the request is forwarded
      the current requestUri may no longer be compariable to the value of the
      PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE. Also where the request is mapped
      using a pattern, the value of PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE is
      not the same as the lookup path.
      
      This change removes the use of the attribute from ResourceUrlProvider
      and instead always determines the lookup path when getForRequestUrl
      is called.
      
      Issue: SPR-12332
      97441d05
  2. 16 10月, 2014 3 次提交
  3. 15 10月, 2014 2 次提交
    • R
      Prepend leading slash in ResourceUrlProvider · 24d77f32
      Rossen Stoyanchev 提交于
      The getForRequestUrl method of ResourceUrlProvider uses the
      HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE attribute to
      determine the relevant portion of the resource URL path.
      
      However there are cases when that attribute may not have a leading
      (e.g. when the current URL was matched to a prefix-based pattern
      and hence extracted via PathMatcher#extractPathWithinPattern), which
      interferes with the matching of resource URL paths to patterns.
      
      This change ensures a leading slash is present
      
      Issue: SPR-12281
      24d77f32
    • R
      Polish resource handling tests · fa4ba2a8
      Rossen Stoyanchev 提交于
      fa4ba2a8
  4. 14 10月, 2014 1 次提交
    • R
      Add interceptor to resourceHandlerMapping · 2df03d63
      Rossen Stoyanchev 提交于
      The resourceHandlerMapping in the MVC Java config is not configured
      with any interceptors, and in particular those added through the
      InterceptorRegistry, which are otherwise added to all other handler
      mapping beans created by the config. This means that the
      ResourceUrlProviderExposingInterceptor (added in 4.0) is also not
      used for resource requests.
      
      This change ensures the ResourceUrlProviderExposingInterceptor is
      configured on the resourceHandlerMapping.
      
      Issue: SPR-12279
      2df03d63
  5. 13 10月, 2014 1 次提交
  6. 30 9月, 2014 8 次提交
  7. 25 9月, 2014 1 次提交
  8. 24 9月, 2014 1 次提交
  9. 20 9月, 2014 1 次提交
    • R
      Allow ResponseBodyAdvice to modify null return values · a9b2a124
      Rossen Stoyanchev 提交于
      This change defers determination of whether to invoke a message
      converter in case of a null @ResponseBody value (or ResponseEntity with
      a null body) until after the invocation of the ResponseBodyAdvice
      chain. This allows a ResponseBodyAdvice to handle null values
      potentially turning them into non-null value.s
      
      Issue: SPR-12152
      a9b2a124
  10. 17 9月, 2014 3 次提交
  11. 10 9月, 2014 1 次提交
  12. 06 9月, 2014 1 次提交
    • B
      Fix ResourceUrlProvider path check in getForRequestUrl · 6aef1a1d
      Brian Clozel 提交于
      Prior to this change, getForRequestUrl implementation would only work
      for applications with a non-empty servlet path. So web applications
      mapped to "/" would trigger a IllegalStateException while checking the
      current request against the request path within the current mapping.
      
      This change relaxes this and only check that the path within mapping is
      within the request URL.
      
      Issue: SPR-12158
      6aef1a1d
  13. 05 9月, 2014 2 次提交
  14. 04 9月, 2014 6 次提交
    • S
      Fix Jackson @JSONView when using XML serialization · a29e41b9
      Sebastien Deleuze 提交于
      Issue: SPR-12149
      a29e41b9
    • B
      Fix resource-chain XML syntax for cache · 7b93cefe
      Brian Clozel 提交于
      This change moves the resource-cache configuration to the
      <resource-chain/> tag, since enabling/disabling resource cache should
      be driven by a property or a SpEL expression.
      
      So now that configuration can be set with XML attributes:
      
        <mvc:resource-chain resource-cache="true"
        cache-manager="resourceCache" cache-name="test-resource-cache">
      
      In order to mirror the JavaConfig behavior, the "resource-cache"
      attribute is required.
      
      Issue: SPR-12129
      7b93cefe
    • R
      Fix initialization issue in ResourceUrlProvider · d85c1fbd
      Rossen Stoyanchev 提交于
      Before this change ResourceUrlProvider used getUrlMap to detect
      ResourceHttpRequestHandler instances, however the map may contain bean
      names as is the case when using <mvc:resources>. Instead it now uses
      getHandlerMap.
      d85c1fbd
    • R
      Declare ResourceUrlProvider in MVC namespace · 3e390d1f
      Rossen Stoyanchev 提交于
      This change adds a ResourceUrlProvider bean to the
      ResourceBeanDefinitionParser to match the same in the Java config.
      For consistency the name of the bean in the Java config is renamed.
      
      Also a ResourceUrlProviderExposingInterceptor is declares as a global
      MappedInterceptor.
      3e390d1f
    • J
      Polishing · d75f1287
      Juergen Hoeller 提交于
      d75f1287
    • J
      Polishing · 86b7118d
      Juergen Hoeller 提交于
      86b7118d
  15. 03 9月, 2014 1 次提交
    • B
      Transform absolute links in ResourceTransformers · 125ae990
      Brian Clozel 提交于
      Prior to this change, ResourceTransformers that transformed resources by
      updating the links to other resources, worked only if links were
      relative to the resource being transformed.
      For example, when the CssLinkResourceTransformer rewrote links within
      a "main.css" resource, only links such as "../css/other.css" were
      rewritten.
      
      Using relative links is a recommended approach, because it's totally
      independent from the application servlet path, context path, mappings...
      
      This change allows absolute links to be rewritten by those Transformers,
      provided those links are accurate and point to existing resources.
      
      Issue: SPR-12137
      125ae990
  16. 02 9月, 2014 1 次提交
  17. 30 8月, 2014 2 次提交
    • S
      Add HTTP status to ServletRequestHandledEvent · 36542549
      Sebastien Deleuze 提交于
      Issue: SPR-12119
      36542549
    • B
      Change resource handler XML Namespace · 76c46fdb
      Brian Clozel 提交于
      This commit changes the way a <mvc:resource-cache> can be configured
      with a user defined Cache instance.
      
      Now a reference to a CacheManager Bean and a Cache name must be
      provided. This is a more flexible configuration for typical XML setups.
      
        <mvc:resource-cache
          cache-manager="resourceCache"
          cache-name="test-resource-cache"/>
      
      Issue: SPR-12129
      76c46fdb
  18. 29 8月, 2014 2 次提交
    • R
      Remove assertion on number of resource locations · 4df05d1f
      Rossen Stoyanchev 提交于
      With the new ResourceResolver abstraction and resource resolver chain
      in 4.1, the assumption that resources are found by checking for the URL
      path under the configured locations is no longer accurate.
      
      A custom ResourceResolver could find resources in ways that don't
      depend on a list of locations.
      
      Issuse: SPR-12133
      4df05d1f
    • 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