public abstract class AbstractDetectingUrlHandlerMapping extends AbstractUrlHandlerMapping
HandlerMapping
インターフェースの抽象的な実装。アプリケーションコンテキストで定義されたすべての Bean のイントロスペクションを通じてハンドラー Bean の URL マッピングを検出します。determineUrlsForHandler(java.lang.String)
logger
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターと説明 |
---|
AbstractDetectingUrlHandlerMapping() |
修飾子と型 | メソッドと説明 |
---|---|
protected void | detectHandlers() 現在の ApplicationContext にあるすべてのハンドラーを登録します。 |
protected abstract StringSE[] | determineUrlsForHandler(StringSE beanName) 指定されたハンドラー Bean の URL を判別します。 |
void | initApplicationContext() スーパークラスの初期化に加えて、 detectHandlers() メソッドを呼び出します。 |
void | setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts) 祖先 ApplicationContexts でハンドラー Bean を検出するかどうかを設定します。 |
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initInterceptors, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
getHandler
public void setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts)
デフォルトは「false」: 現在の ApplicationContext のハンドラー Bean のみが検出されます。つまり、この HandlerMapping 自体が定義されているコンテキスト(通常は現在の DispatcherServlet のコンテキスト)のみです。
このフラグをオンにして、祖先コンテキスト(通常は Spring ルート WebApplicationContext)のハンドラー Bean も検出します。
public void initApplicationContext() throws ApplicationContextException
detectHandlers()
メソッドを呼び出します。protected void detectHandlers() throws BeansException
ハンドラーの実際の URL 決定は、具体的な determineUrlsForHandler(String)
実装によって異なります。そのような URL を決定できなかった Bean は、単にハンドラーとは見なされません。
BeansException
- ハンドラーを登録できなかった場合 determineUrlsForHandler(String)