Why does SpringMVC divide father and son containers and use only one container?

dao, service scan in parent container
web related scan in child container

is this for layering? Or do you have to do this?
is it okay to use only one container?

Apr.27,2022
The controller layer of

spring mvc can inject service or dao because the child container can see the classes injected by the parent container, but cannot inject in service or dao the contents of the controller parent container that cannot be obtained from the child container


springboot. In addition, there may be more than 2

containers in springcloud.
Menu