在 spring 引导中的休息 api 调用期间调用的第一个函数是什么?

What is the very first function which is called during a rest api call in spring boot?

我想设置一个断点用于调试目的。我从 Postman 呼叫休息 api,我想检查 java 应用程序收到呼叫的第一个点。有听众吗?在哪里设置断点?

我想 DispatcherServlet 就是您要查找的内容。在例如之前还有很多其他东西 运行 servlet 容器和潜在的 servlet 过滤器,但 DispatcherServlet 是调试 Spring MVC 问题的良好起点。

protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception

文档也很好:https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc-servlet

对于 Spring MVC Webflux 应用程序,请查看 DispatcherHandler 并在 public Mono<Void> handle(ServerWebExchange exchange) 中设置断点。