Change resource handler XML Namespace

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
This commit is contained in:
Brian Clozel
2014-08-29 18:51:40 +02:00
parent 4df05d1f98
commit 76c46fdbe3
6 changed files with 37 additions and 14 deletions

View File

@@ -23,7 +23,7 @@
<mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/">
<mvc:resource-chain>
<mvc:resource-cache cache="resourceCache"/>
<mvc:resource-cache cache-manager="resourceCache" cache-name="test-resource-cache"/>
<mvc:resolvers>
<mvc:version-resolver>
<mvc:fixed-version-strategy version="abc" patterns="/**/*.js"/>
@@ -36,7 +36,5 @@
</mvc:resource-chain>
</mvc:resources>
<bean id="resourceCache" class="org.springframework.web.servlet.config.MvcNamespaceTests$TestResourceCache">
<constructor-arg name="name" value="resourceCache"/>
</bean>
<bean id="resourceCache" class="org.springframework.web.servlet.config.MvcNamespaceTests$TestCacheManager"/>
</beans>