今天给自己的一controller加了一个接口 A Interface,启动tomcat 后,console 并没有输出 Request Mapping Url ,也就是 spring 没有扫描到该Controller,
经过一翻debug后发现,
AbstractHandlerMethodMapping 这类的145行 isHandler(getApplicationContext().getType(beanName)) ,
判断调用了RequestMappingHandlerMapping 类 isHandler(Class<?> beanType)进行了 findAnnotation @Controller判断 ,当bean使用cglib 代理,能找到该bean的所有Annotation
当bean是 sun jkd Proxy代理时,上述方法找不到找不到任何Anontation
问题:
1 不知道spring MVC 开发的为什么要这么做?