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

检索所有 @ConfigurationProperties 个 Bean

要检索所有 Bean,请向 发出请求,如以下基于 curl 的示例所示:@ConfigurationPropertiesGET/actuator/configpropsSpring中文文档

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

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

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

{
  "contexts" : {
    "application" : {
      "beans" : {
        "management.endpoints.web.cors-org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties" : {
          "prefix" : "management.endpoints.web.cors",
          "properties" : {
            "allowedOrigins" : [ ],
            "maxAge" : "PT30M",
            "exposedHeaders" : [ ],
            "allowedOriginPatterns" : [ ],
            "allowedHeaders" : [ ],
            "allowedMethods" : [ ]
          },
          "inputs" : {
            "allowedOrigins" : [ ],
            "maxAge" : { },
            "exposedHeaders" : [ ],
            "allowedOriginPatterns" : [ ],
            "allowedHeaders" : [ ],
            "allowedMethods" : [ ]
          }
        },
        "management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties" : {
          "prefix" : "management.endpoints.web",
          "properties" : {
            "pathMapping" : { },
            "exposure" : {
              "include" : [ "*" ],
              "exclude" : [ ]
            },
            "basePath" : "/actuator",
            "discovery" : {
              "enabled" : true
            }
          },
          "inputs" : {
            "pathMapping" : { },
            "exposure" : {
              "include" : [ {
                "value" : "*",
                "origin" : "\"management.endpoints.web.exposure.include\" from property source \"Inlined Test Properties\""
              } ],
              "exclude" : [ ]
            },
            "basePath" : { },
            "discovery" : {
              "enabled" : { }
            }
          }
        },
        "spring.web-org.springframework.boot.autoconfigure.web.WebProperties" : {
          "prefix" : "spring.web",
          "properties" : {
            "localeResolver" : "ACCEPT_HEADER",
            "resources" : {
              "staticLocations" : [ "classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/" ],
              "addMappings" : true,
              "chain" : {
                "cache" : true,
                "compressed" : false,
                "strategy" : {
                  "fixed" : {
                    "enabled" : false,
                    "paths" : [ "/**" ]
                  },
                  "content" : {
                    "enabled" : false,
                    "paths" : [ "/**" ]
                  }
                }
              },
              "cache" : {
                "cachecontrol" : { },
                "useLastModified" : true
              }
            }
          },
          "inputs" : {
            "localeResolver" : { },
            "resources" : {
              "staticLocations" : [ { }, { }, { }, { } ],
              "addMappings" : { },
              "chain" : {
                "cache" : { },
                "compressed" : { },
                "strategy" : {
                  "fixed" : {
                    "enabled" : { },
                    "paths" : [ { } ]
                  },
                  "content" : {
                    "enabled" : { },
                    "paths" : [ { } ]
                  }
                }
              },
              "cache" : {
                "cachecontrol" : { },
                "useLastModified" : { }
              }
            }
          }
        }
      }
    }
  }
}

响应结构

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

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

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

contexts.*.beans.*Spring中文文档

ObjectSpring中文文档

@ConfigurationProperties按 Bean 名称键控的 Bean。Spring中文文档

contexts.*.beans.*.prefixSpring中文文档

StringSpring中文文档

应用于 Bean 属性名称的前缀。Spring中文文档

contexts.*.beans.*.propertiesSpring中文文档

ObjectSpring中文文档

Bean 作为名称-值对的属性。Spring中文文档

contexts.*.beans.*.inputsSpring中文文档

ObjectSpring中文文档

绑定到此 Bean 时使用的配置属性的来源和值。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

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

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

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

contexts.*.beans.*Spring中文文档

ObjectSpring中文文档

@ConfigurationProperties按 Bean 名称键控的 Bean。Spring中文文档

contexts.*.beans.*.prefixSpring中文文档

StringSpring中文文档

应用于 Bean 属性名称的前缀。Spring中文文档

contexts.*.beans.*.propertiesSpring中文文档

ObjectSpring中文文档

Bean 作为名称-值对的属性。Spring中文文档

contexts.*.beans.*.inputsSpring中文文档

ObjectSpring中文文档

绑定到此 Bean 时使用的配置属性的来源和值。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

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

按前缀检索 @ConfigurationProperties Bean

要检索在特定前缀下映射的 bean,请向 发出请求,如以下基于 curl 的示例所示:@ConfigurationPropertiesGET/actuator/configprops/{prefix}Spring中文文档

$ curl 'http://localhost:8080/actuator/configprops/spring.jackson' -i -X GET

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

HTTP/1.1 200 OK
Content-Disposition: inline;filename=f.txt
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 878

{
  "contexts" : {
    "application" : {
      "beans" : {
        "spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties" : {
          "prefix" : "spring.jackson",
          "properties" : {
            "serialization" : { },
            "visibility" : { },
            "parser" : { },
            "datatype" : {
              "jsonNode" : { },
              "enum" : { }
            },
            "deserialization" : { },
            "generator" : { },
            "mapper" : { }
          },
          "inputs" : {
            "serialization" : { },
            "visibility" : { },
            "parser" : { },
            "datatype" : {
              "jsonNode" : { },
              "enum" : { }
            },
            "deserialization" : { },
            "generator" : { },
            "mapper" : { }
          }
        }
      }
    }
  }
}
不需要是准确的,一个更通用的前缀将返回在该前缀词干下映射的所有 bean。{prefix}

响应结构

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

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

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

contexts.*.beans.*Spring中文文档

ObjectSpring中文文档

@ConfigurationProperties按 Bean 名称键控的 Bean。Spring中文文档

contexts.*.beans.*.prefixSpring中文文档

StringSpring中文文档

应用于 Bean 属性名称的前缀。Spring中文文档

contexts.*.beans.*.propertiesSpring中文文档

ObjectSpring中文文档

Bean 作为名称-值对的属性。Spring中文文档

contexts.*.beans.*.inputsSpring中文文档

ObjectSpring中文文档

绑定到此 Bean 时使用的配置属性的来源和值。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

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

不需要是准确的,一个更通用的前缀将返回在该前缀词干下映射的所有 bean。{prefix}
路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

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

contexts.*.beans.*Spring中文文档

ObjectSpring中文文档

@ConfigurationProperties按 Bean 名称键控的 Bean。Spring中文文档

contexts.*.beans.*.prefixSpring中文文档

StringSpring中文文档

应用于 Bean 属性名称的前缀。Spring中文文档

contexts.*.beans.*.propertiesSpring中文文档

ObjectSpring中文文档

Bean 作为名称-值对的属性。Spring中文文档

contexts.*.beans.*.inputsSpring中文文档

ObjectSpring中文文档

绑定到此 Bean 时使用的配置属性的来源和值。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

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