mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Fix docos references to @ConfigurationProperties(prefix="...")
Fixes gh-629
This commit is contained in:
parent
cc4ee653e3
commit
4366d7880e
@ -47,7 +47,7 @@ rules of thumb:
|
|||||||
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`]
|
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`]
|
||||||
and read from there the available external configuration options. The
|
and read from there the available external configuration options. The
|
||||||
`@ConfigurationProperties` has a `name` attribute which acts as a prefix to external
|
`@ConfigurationProperties` has a `name` attribute which acts as a prefix to external
|
||||||
properties, thus `ServerProperties` has `name="server"` and its configuration properties
|
properties, thus `ServerProperties` has `prefix="server"` and its configuration properties
|
||||||
are `server.port`, `server.address` etc. In a running Actuator app look at the
|
are `server.port`, `server.address` etc. In a running Actuator app look at the
|
||||||
`configprops` endpoint.
|
`configprops` endpoint.
|
||||||
* Look for use of `RelaxedEnvironment` to pull configuration values explicitly out of the
|
* Look for use of `RelaxedEnvironment` to pull configuration values explicitly out of the
|
||||||
|
@ -424,7 +424,7 @@ the configuration of your application. For example:
|
|||||||
[source,java,indent=0]
|
[source,java,indent=0]
|
||||||
----
|
----
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(name="connection")
|
@ConfigurationProperties(prefix="connection")
|
||||||
public class ConnectionSettings {
|
public class ConnectionSettings {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
@ -512,7 +512,7 @@ annotations to your `@ConfigurationProperties` class:
|
|||||||
[source,java,indent=0]
|
[source,java,indent=0]
|
||||||
----
|
----
|
||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties(name="connection")
|
@ConfigurationProperties(prefix="connection")
|
||||||
public class ConnectionSettings {
|
public class ConnectionSettings {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
Loading…
Reference in New Issue
Block a user