org.springframework.web.portlet.context

## Class StandardPortletEnvironment

- java.lang.Object
- - org.springframework.core.env.AbstractEnvironment
  - - org.springframework.core.env.StandardEnvironment
    - - org.springframework.web.portlet.context.StandardPortletEnvironment

- All Implemented Interfaces:
    ConfigurableEnvironment, ConfigurablePropertyResolver, Environment, PropertyResolver

      public class StandardPortletEnvironment
      extends StandardEnvironment

  `Environment` implementation to be used by `Servlet`-based web applications. All Portlet-related `ApplicationContext` classes initialize an instance by default.

  Contributes `ServletContext`, `PortletContext`, `PortletConfig` and JNDI-based `PropertySource` instances. See the `customizePropertySources(org.springframework.core.env.MutablePropertySources)` method for details.

  Since:
    3.1
  Author:
    Chris Beams
  See Also:
    `StandardEnvironment`, `StandardServletEnvironment`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PORTLET_CONFIG_PROPERTY_SOURCE_NAME` Portlet config init parameters property source name: "portletConfigInitParams"
    `static String` | `PORTLET_CONTEXT_PROPERTY_SOURCE_NAME` Portlet context init parameters property source name: "portletContextInitParams"

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

      `SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME`

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

      `ACTIVE_PROFILES_PROPERTY_NAME, DEFAULT_PROFILES_PROPERTY_NAME, IGNORE_GETENV_PROPERTY_NAME, logger, RESERVED_DEFAULT_PROFILE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardPortletEnvironment()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `customizePropertySources(MutablePropertySources propertySources)` Customize the set of property sources with those contributed by superclasses as well as those appropriate for standard portlet-based environments: "portletConfigInitParams" "portletContextInitParams" "servletContextInitParams" "jndiProperties"

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

      `acceptsProfiles, addActiveProfile, containsProperty, doGetActiveProfiles, doGetDefaultProfiles, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyAsClass, getPropertySources, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredProperties`

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

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

- - ### Field Detail

    - #### PORTLET_CONTEXT_PROPERTY_SOURCE_NAME

          public static final String PORTLET_CONTEXT_PROPERTY_SOURCE_NAME

      Portlet context init parameters property source name: "portletContextInitParams"
      See Also:
        Constant Field Values

    - #### PORTLET_CONFIG_PROPERTY_SOURCE_NAME

          public static final String PORTLET_CONFIG_PROPERTY_SOURCE_NAME

      Portlet config init parameters property source name: "portletConfigInitParams"
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StandardPortletEnvironment

          public StandardPortletEnvironment()

  - ### Method Detail

    - #### customizePropertySources

          protected void customizePropertySources(MutablePropertySources propertySources)

      Customize the set of property sources with those contributed by superclasses as well as those appropriate for standard portlet-based environments:
      - "portletConfigInitParams"
      - "portletContextInitParams"
      - "servletContextInitParams"
      - "jndiProperties"

      Properties present in "portletConfigInitParams" will take precedence over those in "portletContextInitParams", which takes precedence over those in "servletContextInitParams" and so on.

      Properties in any of the above will take precedence over system properties and environment variables contributed by the `StandardEnvironment` superclass.

      The property sources are added as stubs for now, and will be fully initialized once the actual `PortletConfig`, `PortletContext`, and `ServletContext` objects are available.

      Overrides:
        `customizePropertySources` in class `StandardEnvironment`
      See Also:
        `StandardEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources)`, `AbstractEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources)`, `PortletConfigPropertySource`, `PortletContextPropertySource`, `PortletApplicationContextUtils.initPortletPropertySources(org.springframework.core.env.MutablePropertySources, javax.servlet.ServletContext, javax.portlet.PortletContext, javax.portlet.PortletConfig)`