Polish
This commit is contained in:
@@ -411,6 +411,7 @@ and mark it as disabled. For example:
|
||||
----
|
||||
|
||||
|
||||
|
||||
[[howto-add-a-servlet-filter-or-listener-using-scanning]]
|
||||
==== Add Servlets, Filters, and Listeners using classpath scanning
|
||||
`@WebServlet`, `@WebFilter`, and `@WebListener` annotated classes can be automatically
|
||||
|
||||
@@ -186,13 +186,14 @@ If the https://github.com/mikekelly/hal-browser[HAL Browser] is on the classpath
|
||||
via its webjar (`org.webjars:hal-browser`), or via the `spring-data-rest-hal-browser` then
|
||||
an HTML "`discovery page`", in the form of the HAL Browser, is also provided.
|
||||
|
||||
|
||||
|
||||
[[production-ready-endpoint-cors]]
|
||||
=== CORS support
|
||||
|
||||
http://en.wikipedia.org/wiki/Cross-origin_resource_sharing[Cross-origin resource sharing]
|
||||
(CORS) is a http://www.w3.org/TR/cors/[W3C specification] that allows you to specify in a
|
||||
flexible way what kind of cross domain requests are authorized. Actuator's MVC endpoints
|
||||
can be configured to support such scenario.
|
||||
can be configured to support such scenarios.
|
||||
|
||||
CORS support is disabled by default and is only enabled once the
|
||||
`endpoints.cors.allowed-origins` property has been set. The configuration below permits
|
||||
@@ -208,6 +209,7 @@ TIP: Check {sc-spring-boot-actuator}/autoconfigure/EndpointCorsProperties.{sc-ex
|
||||
for a complete list of options.
|
||||
|
||||
|
||||
|
||||
[[production-ready-customizing-endpoints-programmatically]]
|
||||
=== Adding custom endpoints
|
||||
If you add a `@Bean` of type `Endpoint` then it will automatically be exposed over JMX and
|
||||
@@ -1076,16 +1078,13 @@ used by default if you are on Java 8 or if you are using Dropwizard metrics.
|
||||
|
||||
[[production-ready-metric-writers]]
|
||||
=== Metric writers, exporters and aggregation
|
||||
|
||||
Spring Boot provides a couple of implementations of a marker interface
|
||||
called `Exporter` which can be used to copy metric readings from the
|
||||
in-memory buffers to a place where they can be analyzed and
|
||||
displayed. Indeed, if you provide a `@Bean` that implements the
|
||||
`MetricWriter` interface (or `GaugeWriter` for simple use cases) and
|
||||
mark it `@ExportMetricWriter`, then it will automatically be hooked up
|
||||
to an `Exporter` and fed metric updates every 5 seconds (configured
|
||||
via `spring.metrics.export.delay-millis`). In addition, any
|
||||
`MetricReader` that you define and mark as `@ExportMetricReader` will
|
||||
Spring Boot provides a couple of implementations of a marker interface called `Exporter`
|
||||
which can be used to copy metric readings from the in-memory buffers to a place where they
|
||||
can be analyzed and displayed. Indeed, if you provide a `@Bean` that implements the
|
||||
`MetricWriter` interface (or `GaugeWriter` for simple use cases) and mark it
|
||||
`@ExportMetricWriter`, then it will automatically be hooked up to an `Exporter` and fed
|
||||
metric updates every 5 seconds (configured via `spring.metrics.export.delay-millis`).
|
||||
In addition, any `MetricReader` that you define and mark as `@ExportMetricReader` will
|
||||
have its values exported by the default exporter.
|
||||
|
||||
The default exporter is a `MetricCopyExporter` which tries to optimize itself by not
|
||||
|
||||
@@ -330,16 +330,13 @@ To provide a concrete example, suppose you develop a `@Component` that uses a
|
||||
----
|
||||
|
||||
On your application classpath (e.g. inside your jar) you can have an
|
||||
`application.properties` that provides a sensible default property
|
||||
value for `name`. When running in a new environment, an
|
||||
`application.properties` can be provided outside of your jar that
|
||||
overrides the `name`; and for one-off testing, you can launch with a
|
||||
specific command line switch (e.g. `java -jar app.jar
|
||||
--name="Spring"`).
|
||||
`application.properties` that provides a sensible default property value for `name`. When
|
||||
running in a new environment, an `application.properties` can be provided outside of your
|
||||
jar that overrides the `name`; and for one-off testing, you can launch with a specific
|
||||
command line switch (e.g. `java -jar app.jar --name="Spring"`).
|
||||
|
||||
[TIP]
|
||||
====
|
||||
|
||||
The `SPRING_APPLICATION_JSON` properties can be supplied on the
|
||||
command line with an environment variable. For example in a
|
||||
UN{asterisk}X shell:
|
||||
@@ -366,6 +363,7 @@ or as a JNDI variable `java:comp/env/spring.application.json`.
|
||||
====
|
||||
|
||||
|
||||
|
||||
[[boot-features-external-config-random-values]]
|
||||
=== Configuring random values
|
||||
The `RandomValuePropertySource` is useful for injecting random values (e.g. into secrets
|
||||
|
||||
@@ -27,9 +27,9 @@ work with other build systems (Ant for example), but they will not be particular
|
||||
supported.
|
||||
|
||||
|
||||
|
||||
[[using-boot-dependency-management]]
|
||||
=== Dependency management
|
||||
|
||||
Each release of Spring Boot provides a curated list of dependencies it supports. In
|
||||
practice, you do not need to provide a version for any of these dependencies in your
|
||||
build configuration as Spring Boot is managing that for you. When you upgrade Spring
|
||||
@@ -48,6 +48,7 @@ WARNING: Each release of Spring Boot is associated with a base version of the Sp
|
||||
Framework so we **highly** recommend you to not specify its version on your own.
|
||||
|
||||
|
||||
|
||||
[[using-boot-maven]]
|
||||
=== Maven
|
||||
Maven users can inherit from the `spring-boot-starter-parent` project to obtain sensible
|
||||
@@ -105,6 +106,7 @@ TIP: Check the {github-code}/spring-boot-dependencies/pom.xml[`spring-boot-depen
|
||||
for a list of supported properties.
|
||||
|
||||
|
||||
|
||||
[[using-boot-maven-without-a-parent]]
|
||||
==== Using Spring Boot without the parent POM
|
||||
Not everyone likes inheriting from the `spring-boot-starter-parent` POM. You may have your
|
||||
@@ -164,6 +166,7 @@ NOTE: In the example above, we specify a _BOM_ but any dependency type can be ov
|
||||
that way.
|
||||
|
||||
|
||||
|
||||
[[using-boot-maven-java-version]]
|
||||
==== Changing the Java version
|
||||
The `spring-boot-starter-parent` chooses fairly conservative Java compatibility. If you
|
||||
|
||||
Reference in New Issue
Block a user