org.apache.myfaces.trinidad.resource

## Class ServletContextResourceLoader

- java.lang.Object
- - org.apache.myfaces.trinidad.resource.ResourceLoader
  - - org.apache.myfaces.trinidad.resource.ServletContextResourceLoader

-     public class ServletContextResourceLoader
      extends ResourceLoader

  A resource loader implementation which loads resources using the servlet context.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletContextResourceLoader(javax.servlet.ServletContext context)` Constructs a new ServletContextResourceLoader.
    `ServletContextResourceLoader(javax.servlet.ServletContext context, ResourceLoader parent)` Constructs a new ServletContextResourceLoader with specified parent resource loader.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected URL` | `findResource(String path)` Finds the resource with the given name.

    - ### Methods inherited from class org.apache.myfaces.trinidad.resource.ResourceLoader

      `getContentType, getContentType, getNullResourceLoader, getParent, getResource, isCachable, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ServletContextResourceLoader

          public ServletContextResourceLoader(javax.servlet.ServletContext context)

      Constructs a new ServletContextResourceLoader.
      Parameters:
        `context` - the servlet context

    - #### ServletContextResourceLoader

          public ServletContextResourceLoader(javax.servlet.ServletContext context,
                                      ResourceLoader parent)

      Constructs a new ServletContextResourceLoader with specified parent resource loader.
      Parameters:
        `context` - the servlet context
        `parent` - the parent resource loader

  - ### Method Detail

    - #### findResource

          protected URL findResource(String path)
                              throws IOException

      Description copied from class: `ResourceLoader`
      Finds the resource with the given name. Resource loader implementations should override this method to specify where to find resources.
      Overrides:
        `findResource` in class `ResourceLoader`
      Parameters:
        `path` - The resource name
      Returns:
        A `URL` object for reading the resource, or `null` if the resource could not be found
      Throws:
        `IOException`

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.