类 StandardServletEnvironment
- 所有已实现的接口:
cn.taketoday.core.env.ConfigurableEnvironment,cn.taketoday.core.env.ConfigurablePropertyResolver,cn.taketoday.core.env.Environment,cn.taketoday.core.env.IterablePropertyResolver,cn.taketoday.core.env.PropertyResolver,ConfigurableWebEnvironment,Iterable<String>
Environment implementation to be used by Servlet-based web
applications. All web-related (servlet-based) ApplicationContext classes
initialize an instance by default.
Contributes ServletConfig, ServletContext, and JNDI-based
PropertySource instances. See customizePropertySources(cn.taketoday.core.env.PropertySources) method
documentation for details.
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams, Juergen Hoeller
- 另请参阅:
-
StandardEnvironment
-
字段概要
字段修饰符和类型字段说明static final StringJNDI property source name: "jndiProperties".private static final booleanstatic final StringServlet config init parameters property source name: "servletConfigInitParams".static final StringServlet context init parameters property source name: "servletContextInitParams".从类继承的字段 cn.taketoday.core.env.StandardEnvironment
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME从接口继承的字段 cn.taketoday.core.env.Environment
DEFAULT_PROFILE, ENVIRONMENT_BEAN_NAME, KEY_ACTIVE_PROFILES, KEY_DEFAULT_PROFILES, KEY_IGNORE_GETENV, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME -
构造器概要
构造器限定符构造器说明Create a newStandardServletEnvironmentinstance.protectedStandardServletEnvironment(cn.taketoday.core.env.PropertySources propertySources) Create a newStandardServletEnvironmentinstance with a specificPropertySourcesinstance. -
方法概要
修饰符和类型方法说明protected voidcustomizePropertySources(cn.taketoday.core.env.PropertySources propertySources) Customize the set of property sources with those contributed by superclasses as well as those appropriate for standard servlet-based environments: "servletConfigInitParams" "servletContextInitParams" "jndiProperties"voidinitPropertySources(ServletContext servletContext, ServletConfig servletConfig) Replace any stub property source instances acting as placeholders with real servlet context/config property sources using the given parameters.从类继承的方法 cn.taketoday.core.env.AbstractEnvironment
acceptsProfiles, addActiveProfile, addRequiredProperties, containsProperty, createPropertyResolver, doGetActiveProfiles, doGetActiveProfilesProperty, doGetDefaultProfiles, doGetDefaultProfilesProperty, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyResolver, getPropertySources, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, iterator, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredProperties从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.core.env.ConfigurableEnvironment
addActiveProfile, getPropertySources, getSystemEnvironment, getSystemProperties, merge, setActiveProfiles, setDefaultProfiles从接口继承的方法 cn.taketoday.core.env.ConfigurablePropertyResolver
addRequiredProperties, getConversionService, setConversionService, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredProperties从接口继承的方法 cn.taketoday.core.env.Environment
acceptsProfiles, getActiveProfiles, getDefaultProfiles, matchesProfiles从接口继承的方法 java.lang.Iterable
forEach, spliterator从接口继承的方法 cn.taketoday.core.env.PropertyResolver
containsProperty, getFlag, getFlag, getProperty, getProperty, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolvePlaceholders, resolveRequiredPlaceholders
-
字段详细资料
-
SERVLET_CONTEXT_PROPERTY_SOURCE_NAME
Servlet context init parameters property source name: "servletContextInitParams".- 另请参阅:
-
SERVLET_CONFIG_PROPERTY_SOURCE_NAME
Servlet config init parameters property source name: "servletConfigInitParams".- 另请参阅:
-
JNDI_PROPERTY_SOURCE_NAME
JNDI property source name: "jndiProperties".- 另请参阅:
-
jndiPresent
private static final boolean jndiPresent
-
-
构造器详细资料
-
StandardServletEnvironment
public StandardServletEnvironment()Create a newStandardServletEnvironmentinstance. -
StandardServletEnvironment
protected StandardServletEnvironment(cn.taketoday.core.env.PropertySources propertySources) Create a newStandardServletEnvironmentinstance with a specificPropertySourcesinstance.- 参数:
propertySources- property sources to use
-
-
方法详细资料
-
customizePropertySources
protected void customizePropertySources(cn.taketoday.core.env.PropertySources propertySources) Customize the set of property sources with those contributed by superclasses as well as those appropriate for standard servlet-based environments:Properties present in "servletConfigInitParams" will take precedence over those in "servletContextInitParams", and properties found in either of the above take precedence over those found in "jndiProperties".
Properties in any of the above will take precedence over system properties and environment variables contributed by the
StandardEnvironmentsuperclass.The
Servlet-related property sources are added asstubsat this stage, and will be fully initialized once the actualServletContextobject becomes available.Addition of "jndiProperties" can be disabled with
- 覆盖:
customizePropertySources在类中cn.taketoday.core.env.StandardEnvironment- 另请参阅:
-
StandardEnvironment.customizePropertySources(cn.taketoday.core.env.PropertySources)AbstractEnvironment.customizePropertySources(cn.taketoday.core.env.PropertySources)ServletConfigPropertySourceServletContextPropertySourceJndiPropertySourceAbstractApplicationContext.initPropertySources()initPropertySources(ServletContext, ServletConfig)
-
initPropertySources
public void initPropertySources(@Nullable ServletContext servletContext, @Nullable ServletConfig servletConfig) 从接口复制的说明:ConfigurableWebEnvironmentReplace any stub property source instances acting as placeholders with real servlet context/config property sources using the given parameters.- 指定者:
initPropertySources在接口中ConfigurableWebEnvironment- 参数:
servletContext- theServletContext(may not benull)servletConfig- theServletConfig(nullif not available)
-