此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1Spring中文文档

此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1Spring中文文档

端点提供有关应用程序的 Bean 的信息。beansSpring中文文档

检索 Bean

要检索 bean,请向 发出请求,如以下基于 curl 的示例所示:GET/actuator/beansSpring中文文档

$ curl 'http://localhost:8080/actuator/beans' -i -X GET

生成的响应类似于以下内容:Spring中文文档

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1089

{
  "contexts" : {
    "application" : {
      "beans" : {
        "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration" : {
          "aliases" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration",
          "dependencies" : [ ]
        },
        "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration" : {
          "aliases" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration",
          "dependencies" : [ ]
        },
        "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration" : {
          "aliases" : [ ],
          "scope" : "singleton",
          "type" : "org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration",
          "dependencies" : [ ]
        }
      }
    }
  }
}

响应结构

响应包含应用程序的 Bean 的详细信息。 下表描述了响应的结构:Spring中文文档

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

按 id 键控的应用程序上下文。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

父应用程序上下文的 ID(如果有)。Spring中文文档

contexts.*.beansSpring中文文档

ObjectSpring中文文档

应用程序上下文中按名称键控的 Bean。Spring中文文档

contexts.*.beans.*.aliasesSpring中文文档

ArraySpring中文文档

任何别名的名称。Spring中文文档

contexts.*.beans.*.scopeSpring中文文档

StringSpring中文文档

Bean 的范围。Spring中文文档

contexts.*.beans.*.typeSpring中文文档

StringSpring中文文档

完全合格的豆子类型。Spring中文文档

contexts.*.beans.*.resourceSpring中文文档

StringSpring中文文档

定义 Bean 的资源(如果有)。Spring中文文档

contexts.*.beans.*.dependenciesSpring中文文档

ArraySpring中文文档

任何依赖项的名称。Spring中文文档

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

按 id 键控的应用程序上下文。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

父应用程序上下文的 ID(如果有)。Spring中文文档

contexts.*.beansSpring中文文档

ObjectSpring中文文档

应用程序上下文中按名称键控的 Bean。Spring中文文档

contexts.*.beans.*.aliasesSpring中文文档

ArraySpring中文文档

任何别名的名称。Spring中文文档

contexts.*.beans.*.scopeSpring中文文档

StringSpring中文文档

Bean 的范围。Spring中文文档

contexts.*.beans.*.typeSpring中文文档

StringSpring中文文档

完全合格的豆子类型。Spring中文文档

contexts.*.beans.*.resourceSpring中文文档

StringSpring中文文档

定义 Bean 的资源(如果有)。Spring中文文档

contexts.*.beans.*.dependenciesSpring中文文档

ArraySpring中文文档

任何依赖项的名称。Spring中文文档