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.
StandardEnvironment
,
StandardServletEnvironment
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"
|
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME
ACTIVE_PROFILES_PROPERTY_NAME, DEFAULT_PROFILES_PROPERTY_NAME, IGNORE_GETENV_PROPERTY_NAME, logger, RESERVED_DEFAULT_PROFILE_NAME
Constructor and Description |
---|
StandardPortletEnvironment() |
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"
|
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.
|
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
public static final String PORTLET_CONTEXT_PROPERTY_SOURCE_NAME
public static final String PORTLET_CONFIG_PROPERTY_SOURCE_NAME
protected void customizePropertySources(MutablePropertySources propertySources)
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.
customizePropertySources
in class StandardEnvironment
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)
public void initPropertySources(ServletContext servletContext, PortletContext portletContext, PortletConfig portletConfig)
servletContext
- the ServletContext
(may be null
)portletContext
- the PortletContext
(may not be null
)portletConfig
- the PortletConfig
(null
if not available)PortletApplicationContextUtils.initPortletPropertySources(
org.springframework.core.env.MutablePropertySources, ServletContext, PortletContext, PortletConfig)