クラス WebApplicationObjectSupport
java.lang.ObjectSE
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
- 実装されたすべてのインターフェース:
Aware
、ApplicationContextAware
、ServletContextAware
- 既知の直属サブクラス
AbstractCachingViewResolver
、AbstractHandlerMapping
、AbstractView
、BeanNameViewResolver
、ContentNegotiatingViewResolver
、ServerEndpointExporter
、WebContentGenerator
public abstract class WebApplicationObjectSupport
extends ApplicationObjectSupport
implements ServletContextAware
WebApplicationContext
で実行されるアプリケーションオブジェクト用の便利なスーパークラス。getWebApplicationContext()
、getServletContext()
、getTempDir()
アクセサーを提供します。 メモ: 通常、必要な実際のコールバックには個別のコールバックインターフェースを使用することをお勧めします。この広範な基本クラスは、主に ServletContext
EE アクセスなどが必要な場合に、主にフレームワーク内で使用することを目的としています。
- 導入:
- 28.08.2003
- 作成者:
- Juergen Hoeller
- 関連事項:
フィールドのサマリー
クラス org.springframework.context.support.ApplicationObjectSupport から継承されたフィールド
logger
コンストラクターのサマリー
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected final ServletContextEE
現在の ServletContext を返します。protected final FileSE
サーブレットコンテナーによって提供される、現在の Web アプリケーションの一時ディレクトリを返します。protected final WebApplicationContext
現在のアプリケーションコンテキストを WebApplicationContext として返します。protected void
initApplicationContext
(ApplicationContext context) 指定された ApplicationContext がWebApplicationContext
の場合、initServletContext(jakarta.servlet.ServletContext)
を呼び出します。protected void
initServletContext
(ServletContextEE servletContext) サブクラスは、このアプリケーションオブジェクトが実行される ServletContext に基づいて、カスタム初期化のためにこれをオーバーライドできます。protected boolean
基本クラスの動作をオーバーライドして、ApplicationContext での実行を強制します。final void
setServletContext
(ServletContextEE servletContext) このオブジェクトが実行されるServletContext
EE を設定します。クラス org.springframework.context.support.ApplicationObjectSupport から継承されたメソッド
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
コンストラクターの詳細
WebApplicationObjectSupport
public WebApplicationObjectSupport()
メソッドの詳細
setServletContext
インターフェースからコピーされた説明:ServletContextAware
このオブジェクトが実行されるServletContext
EE を設定します。通常の Bean プロパティの設定後、InitializingBean の
afterPropertiesSet
またはカスタム init メソッドのような初期コールバックの前に呼び出されます。ApplicationContextAware のsetApplicationContext
の後に呼び出されます。- 次で指定:
- インターフェース
ServletContextAware
のsetServletContext
- パラメーター:
servletContext
- このオブジェクトによって使用される ServletContext オブジェクト- 関連事項:
isContextRequired
protected boolean isContextRequired()基本クラスの動作をオーバーライドして、ApplicationContext での実行を強制します。コンテキストで実行されていない場合、すべてのアクセサーは IllegalStateException をスローします。initApplicationContext
指定された ApplicationContext がWebApplicationContext
の場合、initServletContext(jakarta.servlet.ServletContext)
を呼び出します。- オーバーライド:
- クラス
ApplicationObjectSupport
のinitApplicationContext
- パラメーター:
context
- 含む ApplicationContext- 関連事項:
initServletContext
サブクラスは、このアプリケーションオブジェクトが実行される ServletContext に基づいて、カスタム初期化のためにこれをオーバーライドできます。デフォルトの実装は空です。
initApplicationContext(org.springframework.context.ApplicationContext)
およびsetServletContext(jakarta.servlet.ServletContext)
によって呼び出されます。- パラメーター:
servletContext
- このアプリケーションオブジェクトが実行される ServletContext (非null
)
getWebApplicationContext
@Nullable protected final WebApplicationContext getWebApplicationContext() throws IllegalStateExceptionSE現在のアプリケーションコンテキストを WebApplicationContext として返します。注意 : これは、実際に WebApplicationContext 固有の機能にアクセスする必要がある場合にのみ使用してください。非 WebApplicationContext 環境でも実行できるようにするには、
getApplicationContext()
またはgetServletContext()
を使用することをお勧めします。- 例外:
IllegalStateExceptionSE
- WebApplicationContext で実行されていない場合- 関連事項:
getServletContext
現在の ServletContext を返します。- 例外:
IllegalStateExceptionSE
- 必要な ServletContext 内で実行されていない場合- 関連事項:
getTempDir
サーブレットコンテナーによって提供される、現在の Web アプリケーションの一時ディレクトリを返します。- 戻り値:
- 一時ディレクトリを表すファイル
- 例外:
IllegalStateExceptionSE
- ServletContext 内で実行されていない場合- 関連事項: