只有对应的HandlerMapping (为了实现类型级别的注解)和/ 或HandlerAdapter (为了实现方法级别的注解)出现在 dispatcher中时, @RequestMapping 才会被处理。 这在DispatcherServlet 和DispatcherPortlet 中都是缺省的行为。
然而,如果是在定义自己的HandlerMappings 或HandlerAdapters , 就需要确保一个对应的自定义的DefaultAnnotationHandlerMapping 和 /或AnnotationMethodHandlerAdapter 同样被定义——假设想要使用@RequestMapping 。