Skip to main content

Parent/Child Contexts, Dependency Resolution Internals, Bean Registry and Lifecycle Management

Learn Parent/Child Contexts, Dependency Resolution Internals, Bean Registry and Lifecycle Management (Phase 6 · Spring Container (Essential), Spring Core) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Context hierarchy • A context can have a parent ( setParent ). Lookups go child → parent (never parent → child): children see the parent's beans, and can override by name. Classic Spring MVC : a root context (services, repositories) with a child DispatcherServlet context (controllers, view resolvers). Spring Cloud bootstrap and Actuator management contexts use the same mechanism. Boot normally uses a single context; use hierarchies via SpringApplicationBuilder.parent(...).child(...) .

More lessons in Phase 6 · Spring Container (Essential)