在spring mvc中@Controller注解的bean必须由DispatcherServlet初始化的children webApplicationContext来管理,在DispatcherServlet初始化的context中会扫描当前容器所有的bean实例,根据类级别以及方法级别的映射信息注解组装成对应的HandleMappering信息,但是ContextLoaderListener是不具备这个功能的。
@Controller注解的bean如果在ContextLoaderListener中加载的,那么URL路径与Controller方法的映射关系将不会初始化。