|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2013 the original author or authors. |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -37,6 +37,7 @@ import org.springframework.web.context.support.ServletContextResourcePatternReso |
|
|
|
* Spring-specific subclass of the Tiles ServletApplicationContext. |
|
|
|
* Spring-specific subclass of the Tiles ServletApplicationContext. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
* @author Rossen Stoyanchev |
|
|
|
|
|
|
|
* @author Juergen Hoeller |
|
|
|
* @since 3.2 |
|
|
|
* @since 3.2 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class SpringWildcardServletTilesApplicationContext extends ServletApplicationContext { |
|
|
|
public class SpringWildcardServletTilesApplicationContext extends ServletApplicationContext { |
|
|
|
@ -77,24 +78,26 @@ public class SpringWildcardServletTilesApplicationContext extends ServletApplica |
|
|
|
resources = this.resolver.getResources(path); |
|
|
|
resources = this.resolver.getResources(path); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (IOException ex) { |
|
|
|
catch (IOException ex) { |
|
|
|
return Collections.<ApplicationResource> emptyList(); |
|
|
|
((ServletContext) getContext()).log("Resource retrieval failed for path: " + path, ex); |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
} |
|
|
|
Collection<ApplicationResource> resourceList = new ArrayList<ApplicationResource>(); |
|
|
|
if (ObjectUtils.isEmpty(resources)) { |
|
|
|
if (!ObjectUtils.isEmpty(resources)) { |
|
|
|
((ServletContext) getContext()).log("No resources found for path pattern: " + path); |
|
|
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Collection<ApplicationResource> resourceList = new ArrayList<ApplicationResource>(resources.length); |
|
|
|
for (Resource resource : resources) { |
|
|
|
for (Resource resource : resources) { |
|
|
|
URL url; |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
url = resource.getURL(); |
|
|
|
URL url = resource.getURL(); |
|
|
|
resourceList.add(new URLApplicationResource(url.toExternalForm(), url)); |
|
|
|
resourceList.add(new URLApplicationResource(url.toExternalForm(), url)); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (IOException ex) { |
|
|
|
catch (IOException ex) { |
|
|
|
// shouldn't happen with the kind of resources we're using
|
|
|
|
// Shouldn't happen with the kind of resources we're using
|
|
|
|
throw new IllegalArgumentException("No URL for " + resource.toString(), ex); |
|
|
|
throw new IllegalArgumentException("No URL for " + resource, ex); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return resourceList; |
|
|
|
return resourceList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|