org.springframework.web.context.support

## Class ServletContextPropertySource

- java.lang.Object
- - org.springframework.core.env.PropertySource<T>
  - - org.springframework.core.env.EnumerablePropertySource<ServletContext>
    - - org.springframework.web.context.support.ServletContextPropertySource

-     public class ServletContextPropertySource
      extends EnumerablePropertySource<ServletContext>

  `PropertySource` that reads init parameters from a `ServletContext` object.
  Since:
    3.1
  Author:
    Chris Beams
  See Also:
    `ServletConfigPropertySource`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource

      `PropertySource.StubPropertySource`

  - ### Field Summary

    - ### Fields inherited from class org.springframework.core.env.EnumerablePropertySource

      `EMPTY_NAMES_ARRAY, logger`

    - ### Fields inherited from class org.springframework.core.env.PropertySource

      `name, source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletContextPropertySource(String name, ServletContext servletContext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getProperty(String name)` Return the value associated with the given name, `null` if not found.
    `String[]` | `getPropertyNames()` Return the names of all properties contained by the source object (never `null`).

    - ### Methods inherited from class org.springframework.core.env.EnumerablePropertySource

      `containsProperty`

    - ### Methods inherited from class org.springframework.core.env.PropertySource

      `equals, getName, getSource, hashCode, named, toString`

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

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

- - ### Constructor Detail

    - #### ServletContextPropertySource

          public ServletContextPropertySource(String name,
                                              ServletContext servletContext)

  - ### Method Detail

    - #### getPropertyNames

          public String[] getPropertyNames()

      Description copied from class: `EnumerablePropertySource`
      Return the names of all properties contained by the source object (never `null`).
      Specified by:
        `getPropertyNames` in class `EnumerablePropertySource<ServletContext>`

    - #### getProperty

          public String getProperty(String name)

      Description copied from class: `PropertySource`
      Return the value associated with the given name, `null` if not found.
      Specified by:
        `getProperty` in class `PropertySource<ServletContext>`
      Parameters:
        `name` - the property to find
      See Also:
        `PropertyResolver.getRequiredProperty(String)`