Spring Framework PathResourceResolver - 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 PathResourceResolver class.

This code example shows how to use the following methods:
 
	@Test 
	public void resourceChainWithOverrides() throws Exception { 
		CachingResourceResolver cachingResolver = Mockito.mock(CachingResourceResolver.class); 
		VersionResourceResolver versionResolver = Mockito.mock(VersionResourceResolver.class); 
		PathResourceResolver pathResourceResolver = new PathResourceResolver(); 
		CachingResourceTransformer cachingTransformer = Mockito.mock(CachingResourceTransformer.class); 
		AppCacheManifestTransformer appCacheTransformer = Mockito.mock(AppCacheManifestTransformer.class); 
		CssLinkResourceTransformer cssLinkTransformer = new CssLinkResourceTransformer(); 
 
		this.registration.setCachePeriod(3600) 
				.resourceChain(false) 
					.addResolver(cachingResolver) 
					.addResolver(versionResolver) 
					.addResolver(pathResourceResolver) 
					.addTransformer(cachingTransformer) 
					.addTransformer(appCacheTransformer) 
					.addTransformer(cssLinkTransformer); 
 
		ResourceHttpRequestHandler handler = getHandler("/resources/**"); 

7
CodeRank
This code example shows how to use the following methods:
	 * {@link PathResourceResolver} is used in order to match URL paths to 
	 * resources under the configured locations. 
	 * 
	 * @param cacheResources whether to cache the result of resource resolution; 
	 * 		setting this to "true" is recommended for production (and "false" for 
	 * 	    development, especially when applying a version strategy). 
	 * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation 
	 * @since 4.1 
	 */ 
	public ResourceChainRegistration resourceChain(boolean cacheResources) {
		this.resourceChainRegistration = new ResourceChainRegistration(cacheResources);
		return this.resourceChainRegistration;
	} 
 
	/** 
	 * Configure a chain of resource resolvers and transformers to use. This 
	 * can be useful for example to apply a version strategy to resource URLs. 
	 * 
	 * <p>If this method is not invoked, by default only a simple 
	 * {@link PathResourceResolver} is used in order to match URL paths to 
6
CodeRank
See Code Examples for Spring Framework PathResourceResolver Methods: