Polish docs

This commit is contained in:
Phillip Webb
2021-05-05 23:41:52 -07:00
parent aeea15be0f
commit d3207b107c
31 changed files with 92 additions and 76 deletions

View File

@@ -66,12 +66,14 @@ Disable launch script configuration when building a jar file that is intended to
Heres how you can launch your jar with a `layertools` jar mode:
[source,shell,indent=0,subs="verbatim"]
----
$ java -Djarmode=layertools -jar my-app.jar
----
This will provide the following output:
[subs="verbatim"]
----
Usage:
java -Djarmode=layertools -jar my-app.jar
@@ -85,6 +87,7 @@ Available commands:
The `extract` command can be used to easily split the application into layers to be added to the dockerfile.
Here's an example of a Dockerfile using `jarmode`.
[source,dockerfile,indent=0,subs="verbatim"]
----
FROM adoptopenjdk:11-jre-hotspot as builder
WORKDIR application
@@ -103,9 +106,9 @@ ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
Assuming the above `Dockerfile` is in the current directory, your docker image can be built with `docker build .`, or optionally specifying the path to your application jar, as shown in the following example:
[indent=0]
[source,shell,indent=0,subs="verbatim"]
----
docker build --build-arg JAR_FILE=path/to/myapp.jar .
$ docker build --build-arg JAR_FILE=path/to/myapp.jar .
----
This is a multi-stage dockerfile.

View File

@@ -34,7 +34,7 @@ Spring Boot provides auto-configuration for Spring MVC that works well with most
The auto-configuration adds the following features on top of Spring's defaults:
* Inclusion of `ContentNegotiatingViewResolver` and `BeanNameViewResolver` beans.
* Support for serving static resources, including support for WebJars (covered <<features#features.developing-web-applications.spring-mvc.static-content,later in this document>>)).
* Support for serving static resources, including support for WebJars (covered <<features#features.developing-web-applications.spring-mvc.static-content,later in this document>>).
* Automatic registration of `Converter`, `GenericConverter`, and `Formatter` beans.
* Support for `HttpMessageConverters` (covered <<features#features.developing-web-applications.spring-mvc.message-converters,later in this document>>).
* Automatic registration of `MessageCodesResolver` (covered <<features#features.developing-web-applications.spring-mvc.message-codes,later in this document>>).
@@ -218,7 +218,7 @@ Nowadays, Content Negotiation is much more reliable.
There are other ways to deal with HTTP clients that don't consistently send proper "Accept" request headers.
Instead of using suffix matching, we can use a query parameter to ensure that requests like `"GET /projects/spring-boot?format=json"` will be mapped to `@GetMapping("/projects/spring-boot")`:
[source,yaml,indent=0,subs="verbatim",configblocks]
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring:
mvc:
@@ -228,7 +228,7 @@ Instead of using suffix matching, we can use a query parameter to ensure that re
Or if you prefer to use a different parameter name:
[source,properties,indent=0,subs="verbatim"]
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring:
mvc:
@@ -239,7 +239,7 @@ Or if you prefer to use a different parameter name:
Most standard media types are supported out-of-the-box, but you can also define new ones:
[source,yaml,indent=0,subs="verbatim",configblocks]
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring:
mvc:
@@ -372,7 +372,7 @@ The name of the file should be the exact status code or a series mask.
For example, to map `404` to a static HTML file, your directory structure would be as follows:
[source,indent=0,subs="verbatim"]
[indent=0,subs="verbatim"]
----
src/
+- main/
@@ -387,7 +387,7 @@ For example, to map `404` to a static HTML file, your directory structure would
To map all `5xx` errors by using a FreeMarker template, your directory structure would be as follows:
[source,indent=0,subs="verbatim"]
[indent=0,subs="verbatim"]
----
src/
+- main/

View File

@@ -125,7 +125,9 @@ The following example shows how to specify two locations:
[source,shell,indent=0,subs="verbatim"]
----
$ java -jar myproject.jar --spring.config.location=optional:classpath:/default.properties,optional:classpath:/override.properties
$ java -jar myproject.jar --spring.config.location=\
optional:classpath:/default.properties,\
optional:classpath:/override.properties
----
TIP: Use the prefix `optional:` if the <<features#features.external-config.files.optional-prefix,locations are optional>> and you don't mind if they don't exist.
@@ -671,7 +673,7 @@ If you wish you return a non-null instance of `Security` even when no properties
[source,java,indent=0,subs="verbatim"]
----
include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java[]
include::{docs-java}/features/externalconfig/typesafeconfigurationproperties/constructorbinding/nonnull/MyProperties.java[tag=*]
----

View File

@@ -11,7 +11,7 @@ Spring Data provides additional projects that help you access a variety of NoSQL
* {spring-data-couchbase}[Couchbase]
* {spring-data-ldap}[LDAP]
Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Elasticsearch, Solr Cassandra, Couchbase, and LDAP.
Spring Boot provides auto-configuration for Redis, MongoDB, Neo4j, Solr, Elasticsearch, Cassandra, Couchbase, LDAP and InfluxDB.
You can make use of the other projects, but you must configure them yourself.
Refer to the appropriate reference documentation at {spring-data}.

View File

@@ -272,6 +272,7 @@ You can register multiple relying parties under the `spring.security.saml2.relyi
- certificate-location: "path-to-verification-cert"
entity-id: "remote-idp-entity-id1"
sso-url: "https://remoteidp1.sso.url"
my-relying-party2:
signing:
credentials:

View File

@@ -171,7 +171,7 @@ include::{docs-java}/features/springapplication/customizingspringapplication/MyA
----
NOTE: The constructor arguments passed to `SpringApplication` are configuration sources for Spring beans.
In most cases, these are references to `@Configuration` classes, but they could also be references to XML configuration or to packages that should be scanned.
In most cases, these are references to `@Configuration` classes, but they could also be direct references `@Component` classes.
It is also possible to configure the `SpringApplication` by using an `application.properties` file.
See _<<features#features.external-config>>_ for details.
@@ -395,7 +395,7 @@ TIP: If you want to know on which HTTP port the application is running, get the
=== Application Startup tracking
During the application startup, the `SpringApplication` and the `ApplicationContext` perform many tasks related to the application lifecycle,
the beans lifecycle or even processing application events.
With {spring-framework-api}/core/metrics/ApplicationStartup.html[`ApplicationStartup`], Spring Framework {spring-framework-docs}/core.html#context-functionality-startup[allows you to track the application startup sequence with ``StartupStep``s].
With {spring-framework-api}/core/metrics/ApplicationStartup.html[`ApplicationStartup`], Spring Framework {spring-framework-docs}/core.html#context-functionality-startup[allows you to track the application startup sequence with `StartupStep` objects].
This data can be collected for profiling purposes, or just to have a better understanding of an application startup process.
You can choose an `ApplicationStartup` implementation when setting up the `SpringApplication` instance.

View File

@@ -105,7 +105,7 @@ For instance, if you use the {tomcat-docs}/jdbc-pool.html#Common_Attributes[Tomc
test-on-borrow: true
----
This will set the pool to wait 10000 ms before throwing an exception if no connection is available, limit the maximum number of connections to 50 and validate the connection before borrowing it from the pool.
This will set the pool to wait 10000ms before throwing an exception if no connection is available, limit the maximum number of connections to 50ms and validate the connection before borrowing it from the pool.
@@ -253,18 +253,24 @@ By default, JPA databases are automatically created *only* if you use an embedde
You can explicitly configure JPA settings by using `+spring.jpa.*+` properties.
For example, to create and drop tables you can add the following line to your `application.properties`:
[indent=0]
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring.jpa.hibernate.ddl-auto=create-drop
spring:
jpa:
hibernate.ddl-auto: "create-drop"
----
NOTE: Hibernate's own internal property name for this (if you happen to remember it better) is `hibernate.hbm2ddl.auto`.
You can set it, along with other Hibernate native properties, by using `+spring.jpa.properties.*+` (the prefix is stripped before adding them to the entity manager).
The following line shows an example of setting JPA properties for Hibernate:
[indent=0]
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring:
jpa:
properties:
hibernate:
"globally_quoted_identifiers": "true"
----
The line in the preceding example passes a value of `true` for the `hibernate.globally_quoted_identifiers` property to the Hibernate entity manager.

View File

@@ -4,7 +4,8 @@ If you have Spring WebFlux on your classpath, you can also choose to use `WebCli
Compared to `RestTemplate`, this client has a more functional feel and is fully reactive.
You can learn more about the `WebClient` in the dedicated {spring-framework-docs}/web-reactive.html#webflux-client[section in the Spring Framework docs].
Spring Boot creates and pre-configures a `WebClient.Builder` for you; it is strongly advised to inject it in your components and use it to create `WebClient` instances.
Spring Boot creates and pre-configures a `WebClient.Builder` for you.
It is strongly advised to inject it in your components and use it to create `WebClient` instances.
Spring Boot is configuring that builder to share HTTP resources, reflect codecs setup in the same fashion as the server ones (see <<features#features.developing-web-applications.spring-webflux.httpcodecs,WebFlux HTTP codecs auto-configuration>>), and more.
The following code shows a typical example: