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_NAME JNDI プロパティソース名: "jndiProperties"。 |
static StringSE | SERVLET_CONFIG_PROPERTY_SOURCE_NAME サーブレット構成の init パラメータープロパティのソース名: "servletConfigInitParams"。 |
static StringSE | SERVLET_CONTEXT_PROPERTY_SOURCE_NAME サーブレットコンテキストの初期化パラメータープロパティのソース名: "servletContextInitParams"。 |
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
修飾子 | コンストラクターと説明 |
---|---|
| 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, validateRequiredProperties
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
addActiveProfile, getPropertySources, getSystemEnvironment, getSystemProperties, merge, setActiveProfiles, setDefaultProfiles
acceptsProfiles, acceptsProfiles, getActiveProfiles, getDefaultProfiles
getConversionService, setConversionService, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredProperties
containsProperty, getProperty, getProperty, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolvePlaceholders, resolveRequiredPlaceholders
public 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
として追加され、実際の ServletContext
EE オブジェクトが利用可能になると完全に初期化されます。
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)
ConfigurableWebEnvironment
ConfigurableWebEnvironment
の initPropertySources
servletContext
- ServletContext
EE (null
でない可能性があります)servletConfig
- ServletConfig
EE (利用できない場合は null
)WebApplicationContextUtils.initServletPropertySources( org.springframework.core.env.MutablePropertySources, ServletContext, ServletConfig)