Spring Framework VersionResourceResolver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework VersionResourceResolver class.

This code example shows how to use the following methods:
		assertThat(transformers, Matchers.hasSize(0)); 
	} 
 
	@Test 
	public void resourceChainWithVersionResolver() throws Exception { 
		VersionResourceResolver versionResolver = new VersionResourceResolver() 
				.addFixedVersionStrategy("fixed", "/**/*.js") 
				.addContentVersionStrategy("/**"); 
 
		this.registration.resourceChain(true).addResolver(versionResolver) 
				.addTransformer(new AppCacheManifestTransformer()); 
 
		ResourceHttpRequestHandler handler = getHandler("/resources/**"); 
		List<ResourceResolver> resolvers = handler.getResourceResolvers(); 
		assertThat(resolvers.toString(), resolvers, Matchers.hasSize(3)); 
		assertThat(resolvers.get(0), Matchers.instanceOf(CachingResourceResolver.class)); 
		assertThat(resolvers.get(1), Matchers.sameInstance(versionResolver)); 
		assertThat(resolvers.get(2), Matchers.instanceOf(PathResourceResolver.class)); 
 
		List<ResourceTransformer> transformers = handler.getResourceTransformers(); 
5
CodeRank
This code example shows how to use the following methods:
	public void addResourceHandlers ( ResourceHandlerRegistry registry ) 
	{ 
		ResourceHandlerRegistration resourceHandlerRegistration = registry.addResourceHandler("/**"); 
		resourceHandlerRegistration.addResourceLocations("/"); 
		ResourceChainRegistration resourceChain = resourceHandlerRegistration.resourceChain(false); 
		VersionResourceResolver versionResolver = new VersionResourceResolver().addContentVersionStrategy("/**"); 
		resourceChain.addResolver(versionResolver); 
	} 
} 
5
CodeRank
See Code Examples for Spring Framework VersionResourceResolver Methods: