public interface WebApplicationContext extends ApplicationContext
このインターフェースは、getServletContext()
メソッドを汎用 ApplicationContext インターフェースに追加し、ブートストラッププロセスでルートコンテキストをバインドする必要がある既知のアプリケーション属性名を定義します。
一般的なアプリケーションコンテキストと同様に、Web アプリケーションコンテキストは階層型です。アプリケーションごとに 1 つのルートコンテキストがありますが、アプリケーションの各サーブレット(MVC フレームワークのディスパッチャーサーブレットを含む)には、独自の子コンテキストがあります。
標準のアプリケーションコンテキストライフサイクル機能に加えて、WebApplicationContext 実装は ServletContextAware
Bean を検出し、それに応じて setServletContext
メソッドを呼び出す必要があります。
ServletContextAware.setServletContext(javax.servlet.ServletContext)
修飾子と型 | フィールドと説明 |
---|---|
static StringSE | CONTEXT_ATTRIBUTES_BEAN_NAME ファクトリ内の ServletContext 属性環境 Bean の名前。 |
static StringSE | CONTEXT_PARAMETERS_BEAN_NAME ファクトリ内の ServletContext init-params 環境 Bean の名前。 |
static StringSE | ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE 起動が成功したときにルート WebApplicationContext をバインドするコンテキスト属性。 |
static StringSE | SCOPE_APPLICATION グローバル Web アプリケーションスコープのスコープ識別子: "application"。 |
static StringSE | SCOPE_REQUEST リクエストスコープのスコープ識別子: 「リクエスト」。 |
static StringSE | SCOPE_SESSION セッションスコープのスコープ識別子: "session"。 |
static StringSE | SERVLET_CONTEXT_BEAN_NAME ファクトリの ServletContext 環境 Bean の名前。 |
FACTORY_BEAN_PREFIX
CLASSPATH_ALL_URL_PREFIX
CLASSPATH_URL_PREFIX
修飾子と型 | メソッドと説明 |
---|---|
ServletContextEE | getServletContext() このアプリケーションの標準サーブレット API ServletContext を返します。 |
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate
getEnvironment
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation
containsLocalBean, getParentBeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch
getMessage, getMessage, getMessage
publishEvent, publishEvent
getResources
getClassLoader, getResource
static final StringSE ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
メモ: ルートコンテキストの起動が失敗した場合、この属性には値として例外またはエラーが含まれる可能性があります。ルート WebApplicationContext を簡単に検索するには、WebApplicationContextUtils を使用します。
static final StringSE SCOPE_REQUEST
static final StringSE SCOPE_SESSION
static final StringSE SCOPE_APPLICATION
static final StringSE SERVLET_CONTEXT_BEAN_NAME
ServletContext
EE, 定数フィールド値 static final StringSE CONTEXT_PARAMETERS_BEAN_NAME
メモ: おそらく ServletConfig パラメーターとマージされました。ServletConfig パラメーターは、同じ名前の ServletContext パラメーターをオーバーライドします。
static final StringSE CONTEXT_ATTRIBUTES_BEAN_NAME
@Nullable ServletContextEE getServletContext()