public class

ServletContextResourceLoader

extends DefaultResourceLoader
java.lang.Object
   ↳ org.springframework.core.io.DefaultResourceLoader
     ↳ org.springframework.web.context.support.ServletContextResourceLoader

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.io.ResourceLoader
Public Constructors
ServletContextResourceLoader(ServletContext servletContext)
Create a new ServletContextResourceLoader.
Protected Methods
Resource getResourceByPath(String path)
This implementation supports file paths beneath the root of the web application.
[Expand]
Inherited Methods
From class org.springframework.core.io.DefaultResourceLoader
From class java.lang.Object
From interface org.springframework.core.io.ResourceLoader

Public Constructors

public ServletContextResourceLoader (ServletContext servletContext)

Create a new ServletContextResourceLoader.

Parameters
servletContext the ServletContext to load resources with

Protected Methods

protected Resource getResourceByPath (String path)

This implementation supports file paths beneath the root of the web application.

Parameters
path the path to the resource
Returns
  • the corresponding Resource handle