Use canonical version for the management's context path.
pull/3561/head
Stephane Nicoll 9 years ago
parent 1bf0abc456
commit e1479a02b7

@ -54,7 +54,7 @@ Example enhanced "/metrics" endpoint with additional "_links":
include::{generated}/metrics/hypermedia/http-response.adoc[]
WARNING: Beware of Actuator endpoint paths clashing with application endpoints.
The easiest way to avoid that is to use a `management.contextPath`, e.g. "/admin".
The easiest way to avoid that is to use a `management.context-path`, e.g. "/admin".
TIP: You can disable the hypermedia support in Actuator endpoints by setting
`endpoints.links.enabled=false`.
@ -62,13 +62,13 @@ TIP: You can disable the hypermedia support in Actuator endpoints by setting
=== Default home page
If the `management.contextPath` is empty, or if the home page provided by the application
If the `management.context-path` is empty, or if the home page provided by the application
happens to be a response body of type `ResourceSupport`, then it will be enhanced with
links to the actuator endpoints. The latter would happen for instance if you use Spring
Data REST to expose `Repository` endpoints.
Example vanilla "/" endpoint if the `management.contextPath` is empty (the "/admin" page
would be the same with different links if `management.contextPath=/admin`):
Example vanilla "/" endpoint if the `management.context-path` is empty (the "/admin" page
would be the same with different links if `management.context-path=/admin`):
include::{generated}/admin/http-response.adoc[]
@ -115,10 +115,10 @@ NOTE: if you are using Spring Data REST, then a dependency on the
`spring-data-rest-hal-browser` will have an equivalent effect.
If you do that then a new endpoint will appear at `/` or `/hal` (relative to the
`management.contextPath`) serving up a static HTML page with some JavaScript that lets you
`management.context-path`) serving up a static HTML page with some JavaScript that lets you
browse the available resources. The default endpoint path depends on whether or not there
is already a static home page ("`index.html`") - if there is not and the
`management.contextPath` is empty, then the HAL browser shows up on the home page.
`management.context-path` is empty, then the HAL browser shows up on the home page.
Example:
@ -155,7 +155,7 @@ or in Gradle
----
If you do that then a new endpoint at `/` or `/docs` (relative to the
`management.contextPath`) will serve up a static HTML page with this documentation in it.
`management.context-path`) will serve up a static HTML page with this documentation in it.
The default endpoint path depends on whether or not there is already a static home page
("index.html" or a HAL browser) - if there is not and the `management.contextPath` is
("index.html" or a HAL browser) - if there is not and the `management.context-path` is
empty, then the docs browser shows up on the home page.

@ -1,2 +1,2 @@
# management.contextPath=/admin
# management.context-path=/admin
logging.path: target/logs

@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue;
@SpringApplicationConfiguration(classes = SampleActuatorApplication.class)
@WebAppConfiguration
@IntegrationTest({ "server.port=0", "management.port=0", "management.address=127.0.0.1",
"management.contextPath:/admin" })
"management.context-path:/admin" })
@DirtiesContext
public class ManagementAddressActuatorApplicationTests {

@ -1,3 +1,3 @@
error.path: /oops
management.contextPath: /admin
management.context-path: /admin
endpoints.health.sensitive: false

@ -1,2 +1,2 @@
# management.contextPath=/admin
# management.context-path=/admin
spring.http.converters.preferred-json-mapper: gson

@ -1,2 +1,2 @@
management.contextPath=/admin
management.context-path=/admin
endpoints.docs.curies.enabled=true

@ -40,7 +40,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@WebAppConfiguration
@SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class)
@DirtiesContext
@TestPropertySource(properties = { "debug=true", "management.contextPath=",
@TestPropertySource(properties = { "debug=true", "management.context-path=",
"endpoints.docs.curies.enabled=false" })
public class SampleHypermediaJpaApplicationCustomLinksPathIntegrationTests {

@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class)
@DirtiesContext
@TestPropertySource(properties = { "endpoints.links.path=/admin",
"management.contextPath=", "endpoints.docs.curies.enabled=false" })
"management.context-path=", "endpoints.docs.curies.enabled=false" })
public class SampleHypermediaJpaApplicationSharedRootIntegrationTests {
@Autowired

@ -39,7 +39,7 @@ import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SampleHypermediaUiApplication.class)
@WebAppConfiguration
@IntegrationTest({ "management.contextPath=", "server.port=0" })
@IntegrationTest({ "management.context-path=", "server.port=0" })
public class SampleHypermediaUiApplicationTests {
@Value("${local.server.port}")

@ -1,2 +1,2 @@
# management.contextPath=/admin
# management.context-path=/admin
endpoints.docs.curies.enabled=true
Loading…
Cancel
Save