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

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.