Class ServletContextResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.web.context.support.ServletContextResourceLoader
- All Implemented Interfaces:
- ResourceLoader
ResourceLoader implementation that resolves paths as ServletContext
 resources, for use outside a WebApplicationContext (for example,
 in an HttpServletBean or GenericFilterBean subclass).
 
Within a WebApplicationContext, resource paths are automatically resolved as ServletContext resources by the context implementation.
- Since:
- 1.0.2
- Author:
- Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoaderDefaultResourceLoader.ClassPathContextResource
- 
Field SummaryFields inherited from interface org.springframework.core.io.ResourceLoaderCLASSPATH_URL_PREFIX
- 
Constructor SummaryConstructorsConstructorDescriptionServletContextResourceLoader(ServletContext servletContext) Create a new ServletContextResourceLoader.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ResourcegetResourceByPath(String path) This implementation supports file paths beneath the root of the web application.Methods inherited from class org.springframework.core.io.DefaultResourceLoaderaddProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader
- 
Constructor Details- 
ServletContextResourceLoaderCreate a new ServletContextResourceLoader.- Parameters:
- servletContext- the ServletContext to load resources with
 
 
- 
- 
Method Details- 
getResourceByPathThis implementation supports file paths beneath the root of the web application.- Overrides:
- getResourceByPathin class- DefaultResourceLoader
- Parameters:
- path- the path to the resource
- Returns:
- the corresponding Resource handle
- See Also:
 
 
-