public class ViewResolverComposite extends ObjectSE implements ViewResolver, Ordered, InitializingBean, ApplicationContextAware, ServletContextAware
ViewResolver。HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| コンストラクターと説明 |
|---|
ViewResolverComposite() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
int | getOrder() このオブジェクトの順序値を取得します。 |
ListSE<ViewResolver> | getViewResolvers() 委譲先のビュー viewResolvers のリストを返します。 |
View | resolveViewName(StringSE viewName, LocaleSE locale) 指定されたビューを名前で解決します。 |
void | setApplicationContext(ApplicationContext applicationContext) このオブジェクトが実行される ApplicationContext を設定します。 |
void | setOrder(int order) |
void | setServletContext(ServletContextEE servletContext) このオブジェクトが実行される ServletContextEE を設定します。 |
void | setViewResolvers(ListSE<ViewResolver> viewResolvers) 委譲先のビュー viewResolvers のリストを設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic void setViewResolvers(ListSE<ViewResolver> viewResolvers)
public ListSE<ViewResolver> getViewResolvers()
public void setOrder(int order)
public int getOrder()
Ordered 値が高いほど、優先度は低くなります。結果として、最も低い値を持つオブジェクトが最高の優先度を持ちます(サーブレット load-on-startup の値に多少似ています)。
同じ順序の値は、影響を受けるオブジェクトの任意のソート位置になります。
Ordered の getOrder Ordered.HIGHEST_PRECEDENCE, Ordered.LOWEST_PRECEDENCEpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException
ApplicationContextAware 通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet() またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) および MessageSourceAware の後に呼び出されます(該当する場合)。
ApplicationContextAware の setApplicationContext applicationContext - このオブジェクトによって使用される ApplicationContext オブジェクト ApplicationContextException - コンテキスト初期化エラーの場合 BeansException - アプリケーションコンテキストメソッドによってスローされた場合 BeanInitializationExceptionpublic void setServletContext(ServletContextEE servletContext)
ServletContextAwareServletContextEE を設定します。 通常の Bean プロパティの設定後、InitializingBean の afterPropertiesSet またはカスタム init メソッドのような初期コールバックの前に呼び出されます。ApplicationContextAware の setApplicationContext の後に呼び出されます。
ServletContextAware の setServletContext servletContext - このオブジェクトが使用する ServletContext オブジェクト InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)public void afterPropertiesSet()
throws ExceptionSEInitializingBeanBeanFactoryAware、ApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean の afterPropertiesSet ExceptionSE - 構成の誤り(必須プロパティの設定の失敗など)の場合、またはその他の理由で初期化が失敗した場合 public View resolveViewName(StringSE viewName, LocaleSE locale) throws ExceptionSE
ViewResolver メモ: ViewResolver チェーンを可能にするために、指定された名前のビューが定義されていない場合、ViewResolver は null を返す必要があります。ただし、これは必須ではありません: 一部の ViewResolvers は、常に指定された名前のビューオブジェクトを構築しようとし、null を返すことができません(ビューの作成が失敗した場合は例外をスローします)。
ViewResolver の resolveViewName viewName - 解決するビューの名前 locale - ビューを解決するロケール。国際化をサポートする ViewResolvers はこれを考慮する必要があります。null (ViewResolver チェーニングを可能にするオプション)ExceptionSE - ビューを解決できない場合 (通常、実際の View オブジェクトの作成に問題がある場合)