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 byServlet
-based web applications. All Portlet-relatedApplicationContext
classes initialize an instance by default.Contributes
ServletContext
,PortletContext
,PortletConfig
and JNDI-basedPropertySource
instances. See thecustomizePropertySources(org.springframework.core.env.MutablePropertySources)
method for details.- Since:
- 3.1
- Author:
- Chris Beams, Juergen Hoeller
- See Also:
StandardEnvironment
,StandardServletEnvironment
Field Summary
Fields Modifier and Type Field 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 Description StandardPortletEnvironment()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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"void
initPropertySources(ServletContext servletContext, PortletContext portletContext, PortletConfig portletConfig)
Replace any stub property source instances acting as placeholders with real portlet context/config property sources using the given parameters.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
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: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
, andServletContext
objects are available.- Overrides:
customizePropertySources
in classStandardEnvironment
- 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)
initPropertySources
public void initPropertySources(ServletContext servletContext, PortletContext portletContext, PortletConfig portletConfig)
Replace any stub property source instances acting as placeholders with real portlet context/config property sources using the given parameters.- Parameters:
servletContext
- theServletContext
(may benull
)portletContext
- thePortletContext
(may not benull
)portletConfig
- thePortletConfig
(null
if not available)- See Also:
PortletApplicationContextUtils.initPortletPropertySources( org.springframework.core.env.MutablePropertySources, ServletContext, PortletContext, PortletConfig)