public class StandardServletEnvironment extends StandardEnvironment implements ConfigurableWebEnvironment
Servlet ベースの Web アプリケーションで使用される Environment 実装。すべての Web 関連(サーブレットベース)の ApplicationContext クラスは、デフォルトでインスタンスを初期化します。ServletConfig、ServletContext、JNDI ベースの PropertySource インスタンスに貢献します。詳細については、customizePropertySources(org.springframework.core.env.MutablePropertySources) メソッドのドキュメントを参照してください。
StandardEnvironment| 修飾子と型 | フィールドと説明 |
|---|---|
static StringSE | JNDI_PROPERTY_SOURCE_NAMEJNDI プロパティソース名: "jndiProperties" . |
static StringSE | SERVLET_CONFIG_PROPERTY_SOURCE_NAME サーブレット構成の初期化パラメータープロパティソース名: "servletConfigInitParams"。 |
static StringSE | SERVLET_CONTEXT_PROPERTY_SOURCE_NAME サーブレットコンテキスト初期化パラメータープロパティソース名: "servletContextInitParams"。 |
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAMEACTIVE_PROFILES_PROPERTY_NAME, DEFAULT_PROFILES_PROPERTY_NAME, IGNORE_GETENV_PROPERTY_NAME, logger, RESERVED_DEFAULT_PROFILE_NAME| 修飾子 | コンストラクターと説明 |
|---|---|
| StandardServletEnvironment() 新しい StandardServletEnvironment インスタンスを作成します。 |
protected | StandardServletEnvironment(MutablePropertySources propertySources) 特定の MutablePropertySources インスタンスを使用して新しい StandardServletEnvironment インスタンスを作成します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected void | customizePropertySources(MutablePropertySources propertySources) プロパティソースのセットを、スーパークラスによって提供されたもの、標準のサーブレットベースの環境に適したものでカスタマイズします。"servletConfigInitParams" "servletContextInitParams" "jndiProperties" |
void | initPropertySources(ServletContextEE servletContext, ServletConfigEE servletConfig) 指定されたパラメーターを使用して、プレースホルダーとして機能するスタブプロパティソースインスタンスを実際のサーブレットコンテキスト / 構成プロパティソースに置き換えます。 |
acceptsProfiles, acceptsProfiles, addActiveProfile, containsProperty, createPropertyResolver, doGetActiveProfiles, doGetActiveProfilesProperty, doGetDefaultProfiles, doGetDefaultProfilesProperty, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyResolver, getPropertySources, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredPropertiescloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEaddActiveProfile, getPropertySources, getSystemEnvironment, getSystemProperties, merge, setActiveProfiles, setDefaultProfilesacceptsProfiles, acceptsProfiles, getActiveProfiles, getDefaultProfiles, matchesProfilesgetConversionService, setConversionService, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredPropertiescontainsProperty, getProperty, getProperty, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolvePlaceholders, resolveRequiredPlaceholderspublic static final StringSE SERVLET_CONTEXT_PROPERTY_SOURCE_NAME
public static final StringSE SERVLET_CONFIG_PROPERTY_SOURCE_NAME
public StandardServletEnvironment()
StandardServletEnvironment インスタンスを作成します。protected StandardServletEnvironment(MutablePropertySources propertySources)
MutablePropertySources インスタンスを使用して新しい StandardServletEnvironment インスタンスを作成します。propertySources - 使用するプロパティソース protected void customizePropertySources(MutablePropertySources propertySources)
"servletConfigInitParams" にあるプロパティは "servletContextInitParams" にあるプロパティよりも優先され、上記のいずれかにあるプロパティは "jndiProperties" にあるプロパティよりも優先されます。
上記のいずれかのプロパティは、StandardEnvironment スーパークラスによって提供されるシステムプロパティおよび環境変数よりも優先されます。
Servlet 関連のプロパティソースはこの段階で stubs として追加され、実際の ServletContextEE オブジェクトが利用可能になると完全に初期化されます。
"jndiProperties" の追加は JndiLocatorDelegate.IGNORE_JNDI_PROPERTY_NAME で無効にできます。
StandardEnvironment の customizePropertySources StandardEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources), AbstractEnvironment.customizePropertySources(org.springframework.core.env.MutablePropertySources), ServletConfigPropertySource, ServletContextPropertySource, JndiPropertySource, AbstractApplicationContext.initPropertySources(), initPropertySources(ServletContext, ServletConfig)public void initPropertySources(@Nullable ServletContextEE servletContext, @Nullable ServletConfigEE servletConfig)
ConfigurableWebEnvironmentConfigurableWebEnvironment の initPropertySources servletContext - ServletContextEE (null でない可能性があります)servletConfig - ServletConfigEE (利用できない場合は null )WebApplicationContextUtils.initServletPropertySources( org.springframework.core.env.MutablePropertySources, ServletContext, ServletConfig)