spring-framework / org.springframework.web.servlet.handler / AbstractDetectingUrlHandlerMapping

AbstractDetectingUrlHandlerMapping

abstract class AbstractDetectingUrlHandlerMapping : AbstractUrlHandlerMapping

Abstract implementation of the org.springframework.web.servlet.HandlerMapping interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.

Author
Juergen Hoeller

Since
2.5

See Also
#determineUrlsForHandler

Constructors

<init>

AbstractDetectingUrlHandlerMapping()

Abstract implementation of the org.springframework.web.servlet.HandlerMapping interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.

Functions

initApplicationContext

open fun initApplicationContext(): Unit

Calls the #detectHandlers() method in addition to the superclass's initialization.

setDetectHandlersInAncestorContexts

open fun setDetectHandlersInAncestorContexts(detectHandlersInAncestorContexts: Boolean): Unit

Set whether to detect handler beans in ancestor ApplicationContexts.

Default is "false": Only handler beans in the current ApplicationContext will be detected, i.e. only in the context that this HandlerMapping itself is defined in (typically the current DispatcherServlet's context).

Switch this flag on to detect handler beans in ancestor contexts (typically the Spring root WebApplicationContext) as well.