Spring web applications have two contexts: web context (child) and root context (parent). If @Controller
beans are defined in dispatcher-servlet.xml
(web context), everything is fine.
But if the beans controller is defined in the parent context ( applicationContext.xml
), then the controllers are not recognized - i.e. their mappings are not configured, so when you try to open /foo/bar
defined in such a controller, the path was not found.
The question is this: how to make controller mappings parsable regardless of where beans are defined.
PS I know that I can move ads into a childβs context, but I donβt want to do this for reasons beyond the scope of this question.
source share