代码之家  ›  专栏  ›  技术社区  ›  Zoltan Altfatter

“找不到”的处理程序方法

  •  6
  • Zoltan Altfatter  · 技术社区  · 9 年前

    当我包括 actuator 并启用 debug 记录消息,那么有很多 Did not find handler method for 日志消息。

    2015-08-14 18:34:25.335 DEBUG 94889 --- [nio-8080-exec-5] o.s.b.a.e.mvc.EndpointHandlerMapping     : Looking up handler method for path /index.html
    2015-08-14 18:34:25.336 DEBUG 94889 --- [nio-8080-exec-5] o.s.b.a.e.mvc.EndpointHandlerMapping     : Did not find handler method for [/index.html]
    

    当我删除 致动器 则这些日志消息消失。

    我已经尝试过Spring Boot 1.2.5和1.3.0.M3版本,其工作原理相同。使用 spring initializr 使用 web 致动器 依赖关系。

    你知道原因是什么吗?

    非常感谢。

    1 回复  |  直到 9 年前
        1
  •  7
  •   Andy Wilkinson    9 年前

    执行器增加 EndpointHandlerMapping 将请求路由到它提供的各种端点。当接收到请求时,SpringMVC会依次请求每个处理程序映射请求的处理程序,一旦提供了一个处理程序,就会停止。当请求 /index.html 制作。没有映射到该路径的端点,因此 端点处理程序映射 回报 null Spring MVC将继续进行下一个映射。