| 对于最新的稳定版本,请使用 Spring Boot 3.5.5! | 
Beans (beans)
这beansendpoint 提供有关应用程序 bean 的信息。
检索 Bean
要检索 bean,请将GET请求/actuator/beans,如以下基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/beans' -i -X GET生成的响应类似于以下内容:
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 的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | 以 id 键入的应用程序上下文。 | 
| 
 | 
 | 父应用程序上下文的 ID(如果有)。 | 
| 
 | 
 | 应用程序上下文中的 Bean 以名称键控。 | 
| 
 | 
 | 任何别名的名称。 | 
| 
 | 
 | Bean 的范围。 | 
| 
 | 
 | 完全合格的豆子类型。 | 
| 
 | 
 | 定义 bean 的资源(如果有)。 | 
| 
 | 
 | 任何依赖项的名称。 |