Fix javadoc links in reference guide
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run
Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions
Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:25], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:25], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
Run CodeQL Analysis / run-analysis (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:17]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run
Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run
Details
Build and Deploy Snapshot / Trigger Docs Build (push) Blocked by required conditions
Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:24], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:17], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:25], map[id:${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }} name:Linux]) (push) Waiting to run
Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:25], map[id:windows-latest name:Windows]) (push) Waiting to run
Details
Run CodeQL Analysis / run-analysis (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:17]) (push) Waiting to run
Details
Run System Tests / Java ${{ matrix.java.version}} (map[toolchain:true version:21]) (push) Waiting to run
Details
Closes gh-47351
This commit is contained in:
parent
cbdd7cf23b
commit
474c9cdeb1
|
@ -46,9 +46,9 @@ When reading the code, remember the following rules of thumb:
|
|||
Pay special attention to the `+@Conditional*+` annotations to find out what features they enable and when.
|
||||
Add `--debug` to the command line or the System property `-Ddebug` to get a log on the console of all the auto-configuration decisions that were made in your app.
|
||||
In a running application with actuator enabled, look at the `conditions` endpoint (`/actuator/conditions` or the JMX equivalent) for the same information.
|
||||
* Look for classes that are javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] (such as javadoc:org.springframework.boot.autoconfigure.web.ServerProperties[]) and read from there the available external configuration options.
|
||||
* Look for classes that are javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] (such as javadoc:org.springframework.boot.web.server.autoconfigure.ServerProperties[]) and read from there the available external configuration options.
|
||||
The javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] annotation has a `name` attribute that acts as a prefix to external properties.
|
||||
Thus, javadoc:org.springframework.boot.autoconfigure.web.ServerProperties[] has `prefix="server"` and its configuration properties are `server.port`, `server.address`, and others.
|
||||
Thus, javadoc:org.springframework.boot.web.server.autoconfigure.ServerProperties[] has `prefix="server"` and its configuration properties are `server.port`, `server.address`, and others.
|
||||
In a running application with actuator enabled, look at the `configprops` endpoint.
|
||||
* Look for uses of the `bind` method on the javadoc:org.springframework.boot.context.properties.bind.Binder[] to pull configuration values explicitly out of the javadoc:org.springframework.core.env.Environment[] in a relaxed manner.
|
||||
It is often used with a prefix.
|
||||
|
|
|
@ -11,7 +11,7 @@ This section addresses those questions.
|
|||
|
||||
By default, batch applications require a javadoc:javax.sql.DataSource[] to store job details.
|
||||
Spring Batch expects a single javadoc:javax.sql.DataSource[] by default.
|
||||
To have it use a javadoc:javax.sql.DataSource[] other than the application’s main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.batch.BatchDataSource[format=annotation].
|
||||
To have it use a javadoc:javax.sql.DataSource[] other than the application’s main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.batch.jdbc.autoconfigure.BatchDataSource[format=annotation].
|
||||
If you do so and want two data sources (for example by retaining the main auto-configured javadoc:javax.sql.DataSource[]), set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
|
||||
To take greater control, add javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation] to one of your javadoc:org.springframework.context.annotation.Configuration[format=annotation] classes or extend javadoc:org.springframework.batch.core.configuration.support.DefaultBatchConfiguration[].
|
||||
See the API documentation of javadoc:org.springframework.batch.core.configuration.annotation.EnableBatchProcessing[format=annotation]
|
||||
|
@ -24,7 +24,7 @@ For more info about Spring Batch, see the {url-spring-batch-site}[Spring Batch p
|
|||
[[howto.batch.specifying-a-transaction-manager]]
|
||||
== Specifying a Batch Transaction Manager
|
||||
|
||||
Similar to xref:batch.adoc#howto.batch.specifying-a-data-source[], you can define a javadoc:org.springframework.transaction.PlatformTransactionManager[] for use in batch processing by annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.batch.BatchTransactionManager[format=annotation].
|
||||
Similar to xref:batch.adoc#howto.batch.specifying-a-data-source[], you can define a javadoc:org.springframework.transaction.PlatformTransactionManager[] for use in batch processing by annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.batch.autoconfigure.BatchTransactionManager[format=annotation].
|
||||
If you do so and want two transaction managers (for example by retaining the auto-configured javadoc:org.springframework.transaction.PlatformTransactionManager[]), set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ If you do so and want two transaction managers (for example by retaining the aut
|
|||
[[howto.batch.specifying-a-task-executor]]
|
||||
== Specifying a Batch Task Executor
|
||||
|
||||
Similar to xref:batch.adoc#howto.batch.specifying-a-data-source[], you can define a javadoc:org.springframework.core.task.TaskExecutor[] for use in batch processing by annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.batch.BatchTaskExecutor[format=annotation].
|
||||
Similar to xref:batch.adoc#howto.batch.specifying-a-data-source[], you can define a javadoc:org.springframework.core.task.TaskExecutor[] for use in batch processing by annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.batch.autoconfigure.BatchTaskExecutor[format=annotation].
|
||||
If you do so and want two task executors (for example by retaining the auto-configured javadoc:org.springframework.core.task.TaskExecutor[]), set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
|
||||
|
||||
|
||||
|
|
|
@ -74,15 +74,15 @@ app:
|
|||
pool-size: 30
|
||||
----
|
||||
|
||||
To address this problem, make use of javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] which will handle the `url` to `jdbc-url` translation for you.
|
||||
You can initialize a javadoc:org.springframework.boot.jdbc.DataSourceBuilder[] from the state of any javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] object using its `initializeDataSourceBuilder()` method.
|
||||
You could inject the javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] that Spring Boot creates automatically, however, that would split your configuration across `+spring.datasource.*+` and `+app.datasource.*+`.
|
||||
To avoid this, define a custom javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] with a custom configuration properties prefix, as shown in the following example:
|
||||
To address this problem, make use of javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] which will handle the `url` to `jdbc-url` translation for you.
|
||||
You can initialize a javadoc:org.springframework.boot.jdbc.DataSourceBuilder[] from the state of any javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] object using its `initializeDataSourceBuilder()` method.
|
||||
You could inject the javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] that Spring Boot creates automatically, however, that would split your configuration across `+spring.datasource.*+` and `+app.datasource.*+`.
|
||||
To avoid this, define a custom javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] with a custom configuration properties prefix, as shown in the following example:
|
||||
|
||||
include-code::configurable/MyDataSourceConfiguration[]
|
||||
|
||||
This setup is equivalent to what Spring Boot does for you by default, except that the pool's type is specified in code and its settings are exposed as `app.datasource.configuration.*` properties.
|
||||
javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] takes care of the `url` to `jdbc-url` translation, so you can configure it as follows:
|
||||
javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] takes care of the `url` to `jdbc-url` translation, so you can configure it as follows:
|
||||
|
||||
[configprops%novalidate,yaml]
|
||||
----
|
||||
|
|
|
@ -131,11 +131,11 @@ The list of supported databases is available in javadoc:org.springframework.boot
|
|||
Migrations can also be written in Java.
|
||||
Flyway will be auto-configured with any beans that implement javadoc:org.flywaydb.core.api.migration.JavaMigration[].
|
||||
|
||||
javadoc:org.springframework.boot.autoconfigure.flyway.FlywayProperties[] provides most of Flyway's settings and a small set of additional properties that can be used to disable the migrations or switch off the location checking.
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.autoconfigure.flyway.FlywayConfigurationCustomizer[] bean.
|
||||
javadoc:org.springframework.boot.flyway.autoconfigure.FlywayProperties[] provides most of Flyway's settings and a small set of additional properties that can be used to disable the migrations or switch off the location checking.
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.flyway.autoconfigure.FlywayConfigurationCustomizer[] bean.
|
||||
|
||||
Spring Boot calls `Flyway.migrate()` to perform the database migration.
|
||||
If you would like more control, provide a javadoc:org.springframework.context.annotation.Bean[format=annotation] that implements javadoc:org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy[].
|
||||
If you would like more control, provide a javadoc:org.springframework.context.annotation.Bean[format=annotation] that implements javadoc:org.springframework.boot.flyway.autoconfigure.FlywayMigrationStrategy[].
|
||||
|
||||
Flyway supports SQL and Java https://documentation.red-gate.com/fd/callbacks-275218509.html[callbacks].
|
||||
To use SQL-based callbacks, place the callback scripts in the `classpath:db/migration` directory.
|
||||
|
@ -144,7 +144,7 @@ Any such beans are automatically registered with javadoc:org.flywaydb.core.Flywa
|
|||
They can be ordered by using javadoc:org.springframework.core.annotation.Order[format=annotation] or by implementing javadoc:org.springframework.core.Ordered[].
|
||||
|
||||
By default, Flyway autowires the (`@Primary`) javadoc:javax.sql.DataSource[] in your context and uses that for migrations.
|
||||
If you like to use a different javadoc:javax.sql.DataSource[], you can create one and mark its javadoc:org.springframework.context.annotation.Bean[format=annotation] as javadoc:org.springframework.boot.autoconfigure.flyway.FlywayDataSource[format=annotation].
|
||||
If you like to use a different javadoc:javax.sql.DataSource[], you can create one and mark its javadoc:org.springframework.context.annotation.Bean[format=annotation] as javadoc:org.springframework.boot.flyway.autoconfigure.FlywayDataSource[format=annotation].
|
||||
If you do so and want two data sources (for example by retaining the main auto-configured javadoc:javax.sql.DataSource[]), remember to set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
|
||||
Alternatively, you can use Flyway's native javadoc:javax.sql.DataSource[] by setting `spring.flyway.[url,user,password]` in external properties.
|
||||
Setting either `spring.flyway.url` or `spring.flyway.user` is sufficient to cause Flyway to use its own javadoc:javax.sql.DataSource[].
|
||||
|
@ -182,13 +182,13 @@ By default, the master change log is read from `db/changelog/db.changelog-master
|
|||
In addition to YAML, Liquibase also supports JSON, XML, and SQL change log formats.
|
||||
|
||||
By default, Liquibase autowires the (`@Primary`) javadoc:javax.sql.DataSource[] in your context and uses that for migrations.
|
||||
If you need to use a different javadoc:javax.sql.DataSource[], you can create one and mark its javadoc:org.springframework.context.annotation.Bean[format=annotation] as javadoc:org.springframework.boot.autoconfigure.liquibase.LiquibaseDataSource[format=annotation].
|
||||
If you need to use a different javadoc:javax.sql.DataSource[], you can create one and mark its javadoc:org.springframework.context.annotation.Bean[format=annotation] as javadoc:org.springframework.boot.liquibase.autoconfigure.LiquibaseDataSource[format=annotation].
|
||||
If you do so and want two data sources (for example by retaining the main auto-configured javadoc:javax.sql.DataSource[]), remember to set the `defaultCandidate` attribute of the javadoc:org.springframework.context.annotation.Bean[format=annotation] annotation to `false`.
|
||||
Alternatively, you can use Liquibase's native javadoc:javax.sql.DataSource[] by setting `spring.liquibase.[driver-class-name,url,user,password]` in external properties.
|
||||
Setting either `spring.liquibase.url` or `spring.liquibase.user` is sufficient to cause Liquibase to use its own javadoc:javax.sql.DataSource[].
|
||||
If any of the three properties has not been set, the value of its equivalent `spring.datasource` property will be used.
|
||||
|
||||
See javadoc:org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties[] for details about available settings such as contexts, the default schema, and others.
|
||||
See javadoc:org.springframework.boot.liquibase.autoconfigure.LiquibaseProperties[] for details about available settings such as contexts, the default schema, and others.
|
||||
|
||||
You can also use a `Customizer<Liquibase>` bean if you want to customize the javadoc:{url-liquibase-javadoc}/liquibase.Liquibase[] instance before it is being used.
|
||||
|
||||
|
@ -263,7 +263,7 @@ Spring Boot will automatically detect beans of the following types that initiali
|
|||
- javadoc:org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer[]
|
||||
- javadoc:jakarta.persistence.EntityManagerFactory[]
|
||||
- javadoc:org.flywaydb.core.Flyway[]
|
||||
- javadoc:org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer[]
|
||||
- javadoc:org.springframework.boot.flyway.autoconfigure.FlywayMigrationInitializer[]
|
||||
- javadoc:org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializer[]
|
||||
- javadoc:liquibase.integration.spring.SpringLiquibase[]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ This section includes topics relating to the Docker Compose support in Spring Bo
|
|||
[[howto.docker-compose.jdbc-url]]
|
||||
== Customizing the JDBC URL
|
||||
|
||||
When using javadoc:org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails[] with Docker Compose, the parameters of the JDBC URL
|
||||
When using javadoc:org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails[] with Docker Compose, the parameters of the JDBC URL
|
||||
can be customized by applying the `org.springframework.boot.jdbc.parameters` label to the
|
||||
service. For example:
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ Note that, thanks to the use of xref:reference:features/external-config.adoc#fea
|
|||
|
||||
This environment-based configuration is applied to the auto-configured javadoc:tools.jackson.databind.json.JsonMapper.Builder[] bean and applies to any mappers created by using the builder, including the auto-configured javadoc:tools.jackson.databind.json.JsonMapper[] bean.
|
||||
|
||||
The context's javadoc:tools.jackson.databind.json.JsonMapper.Builder[] can be customized by one or more javadoc:org.springframework.boot.autoconfigure.jackson.JsonMapperBuilderCustomizer[] beans.
|
||||
The context's javadoc:tools.jackson.databind.json.JsonMapper.Builder[] can be customized by one or more javadoc:org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer[] beans.
|
||||
Such customizer beans can be ordered (Boot's own customizer has an order of 0), letting additional customization be applied both before and after Boot's customization.
|
||||
|
||||
Any beans of type javadoc:tools.jackson.databind.JacksonModule[] are automatically registered with the auto-configured javadoc:tools.jackson.databind.json.JsonMapper.Builder[] and are applied to any javadoc:tools.jackson.databind.json.JsonMapper[] instances that it creates.
|
||||
|
@ -173,7 +173,7 @@ If you have additional servlets you can declare a javadoc:org.springframework.co
|
|||
It is also possible to use javadoc:org.springframework.boot.web.servlet.ServletRegistration[format=annotation] as an annotation-based alternative to javadoc:org.springframework.boot.web.servlet.ServletRegistrationBean[].
|
||||
Because servlets are registered that way, they can be mapped to a sub-context of the javadoc:org.springframework.web.servlet.DispatcherServlet[] without invoking it.
|
||||
|
||||
Configuring the javadoc:org.springframework.web.servlet.DispatcherServlet[] yourself is unusual but if you really need to do it, a javadoc:org.springframework.context.annotation.Bean[format=annotation] of type javadoc:org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath[] must be provided as well to provide the path of your custom javadoc:org.springframework.web.servlet.DispatcherServlet[].
|
||||
Configuring the javadoc:org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath[] yourself is unusual but if you really need to do it, a javadoc:org.springframework.context.annotation.Bean[format=annotation] of type javadoc:org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath[] must be provided as well to provide the path of your custom javadoc:org.springframework.web.servlet.DispatcherServlet[].
|
||||
|
||||
|
||||
|
||||
|
@ -218,7 +218,7 @@ javadoc:org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration[]
|
|||
The prefix is externalized to `spring.freemarker.prefix`, and the suffix is externalized to `spring.freemarker.suffix`.
|
||||
The default values of the prefix and suffix are empty and '`.ftlh`', respectively.
|
||||
You can override javadoc:org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver[] by providing a bean of the same name.
|
||||
FreeMarker variables can be customized by defining a bean of type javadoc:org.springframework.boot.autoconfigure.freemarker.FreeMarkerVariablesCustomizer[].
|
||||
FreeMarker variables can be customized by defining a bean of type javadoc:org.springframework.boot.freemarker.autoconfigure.FreeMarkerVariablesCustomizer[].
|
||||
* If you use Groovy templates (actually, if `groovy-templates` is on your classpath), you also have a javadoc:org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver[] named '`groovyMarkupViewResolver`'.
|
||||
It looks for resources in a loader path by surrounding the view name with a prefix and suffix (externalized to `spring.groovy.template.prefix` and `spring.groovy.template.suffix`).
|
||||
The prefix and suffix have default values of '`classpath:/templates/`' and '`.tpl`', respectively.
|
||||
|
|
|
@ -82,7 +82,7 @@ Thanks to relaxed binding of javadoc:org.springframework.core.env.Environment[]
|
|||
|
||||
To switch off the HTTP endpoints completely but still create a javadoc:org.springframework.web.context.WebApplicationContext[], use `server.port=-1` (doing so is sometimes useful for testing).
|
||||
|
||||
For more details, see xref:reference:web/servlet.adoc#web.servlet.embedded-container.customizing[Customizing Embedded Servlet Containers] in the '`Spring Boot Features`' section, or the javadoc:org.springframework.boot.autoconfigure.web.ServerProperties[] class.
|
||||
For more details, see xref:reference:web/servlet.adoc#web.servlet.embedded-container.customizing[Customizing Embedded Servlet Containers] in the '`Spring Boot Features`' section, or the javadoc:org.springframework.boot.web.server.autoconfigure.ServerProperties[] class.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -870,7 +870,7 @@ Metrics are also tagged by the name of the javadoc:javax.sql.DataSource[] comput
|
|||
|
||||
TIP: By default, Spring Boot provides metadata for all supported data sources.
|
||||
You can add additional javadoc:org.springframework.boot.jdbc.metadata.DataSourcePoolMetadataProvider[] beans if your favorite data source is not supported.
|
||||
See javadoc:org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration[] for examples.
|
||||
See javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourcePoolMetadataProvidersConfiguration[] for examples.
|
||||
|
||||
Also, Hikari-specific metrics are exposed with a `hikaricp` prefix.
|
||||
Each metric is tagged by the name of the pool (you can control it with `spring.datasource.name`).
|
||||
|
|
|
@ -127,7 +127,7 @@ If you have defined your own javadoc:{url-mongodb-driver-sync-javadoc}/com.mongo
|
|||
The auto-configured javadoc:{url-mongodb-driver-sync-javadoc}/com.mongodb.client.MongoClient[] is created using a javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[] bean.
|
||||
If you have defined your own javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[], it will be used without modification and the `spring.data.mongodb` properties will be ignored.
|
||||
Otherwise a javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[] will be auto-configured and will have the `spring.data.mongodb` properties applied to it.
|
||||
In either case, you can declare one or more javadoc:org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer[] beans to fine-tune the javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[] configuration.
|
||||
In either case, you can declare one or more javadoc:org.springframework.boot.mongodb.autoconfigure.MongoClientSettingsBuilderCustomizer[] beans to fine-tune the javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[] configuration.
|
||||
Each will be called in order with the javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings$Builder[] that is used to build the javadoc:{url-mongodb-driver-core-javadoc}/com.mongodb.MongoClientSettings[].
|
||||
|
||||
You can set the configprop:spring.mongodb.uri[] property to change the URL and configure additional settings such as the _replica set_, as shown in the following example:
|
||||
|
|
|
@ -93,7 +93,7 @@ If you need to specify a specific class, you can use the configprop:spring.datas
|
|||
NOTE: For a pooling javadoc:javax.sql.DataSource[] to be created, we need to be able to verify that a valid javadoc:java.sql.Driver[] class is available, so we check for that before doing anything.
|
||||
In other words, if you set `spring.datasource.driver-class-name=com.mysql.jdbc.Driver`, then that class has to be loadable.
|
||||
|
||||
See javadoc:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties[] API documentation for more of the supported options.
|
||||
See javadoc:org.springframework.boot.jdbc.autoconfigure.DataSourceProperties[] API documentation for more of the supported options.
|
||||
These are the standard options that work regardless of xref:data/sql.adoc#data.sql.datasource.connection-pool[the actual implementation].
|
||||
It is also possible to fine-tune implementation-specific settings by using their respective prefix (`+spring.datasource.hikari.*+`, `+spring.datasource.tomcat.*+`, `+spring.datasource.dbcp2.*+`, and `+spring.datasource.oracleucp.*+`).
|
||||
See the documentation of the connection pool implementation you are using for more details.
|
||||
|
@ -490,7 +490,7 @@ Information specified in the URL takes precedence over individual properties, th
|
|||
|
||||
TIP: The "`How-to Guides`" section includes a xref:how-to:data-initialization.adoc#howto.data-initialization.using-basic-sql-scripts[section on how to initialize a database].
|
||||
|
||||
To customize the connections created by a javadoc:io.r2dbc.spi.ConnectionFactory[], that is, set specific parameters that you do not want (or cannot) configure in your central database configuration, you can use a javadoc:org.springframework.boot.autoconfigure.r2dbc.ConnectionFactoryOptionsBuilderCustomizer[] javadoc:org.springframework.context.annotation.Bean[format=annotation].
|
||||
To customize the connections created by a javadoc:io.r2dbc.spi.ConnectionFactory[], that is, set specific parameters that you do not want (or cannot) configure in your central database configuration, you can use a javadoc:org.springframework.boot.r2dbc.autoconfigure.ConnectionFactoryOptionsBuilderCustomizer[] javadoc:org.springframework.context.annotation.Bean[format=annotation].
|
||||
The following example shows how to manually override the database port while the rest of the options are taken from the application configuration:
|
||||
|
||||
include-code::MyR2dbcConfiguration[]
|
||||
|
|
|
@ -83,10 +83,10 @@ The following service connections are currently supported:
|
|||
|===
|
||||
| Connection Details | Matched on
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.activemq.autoconfigure.ActiveMQConnectionDetails[]
|
||||
| Containers named "symptoma/activemq" or "apache/activemq-classic"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jms.artemis.ArtemisConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.artemis.autoconfigure.ArtemisConnectionDetails[]
|
||||
| Containers named "apache/activemq-artemis"
|
||||
|
||||
| javadoc:org.springframework.boot.cassandra.autoconfigure.CassandraConnectionDetails[]
|
||||
|
@ -95,16 +95,16 @@ The following service connections are currently supported:
|
|||
| javadoc:org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchConnectionDetails[]
|
||||
| Containers named "elasticsearch"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.hazelcast.HazelcastConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.hazelcast.autoconfigure.HazelcastConnectionDetails[]
|
||||
| Containers named "hazelcast/hazelcast".
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails[]
|
||||
| Containers named "clickhouse/clickhouse-server", "gvenzl/oracle-free", "gvenzl/oracle-xe", "mariadb", "mssql/server", "mysql", or "postgres"
|
||||
|
||||
| javadoc:org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails[]
|
||||
| Containers named "osixia/openldap", "lldap/lldap"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.mongodb.autoconfigure.MongoConnectionDetails[]
|
||||
| Containers named "mongo"
|
||||
|
||||
| javadoc:org.springframework.boot.neo4j.autoconfigure.Neo4jConnectionDetails[]
|
||||
|
@ -119,13 +119,13 @@ The following service connections are currently supported:
|
|||
| javadoc:org.springframework.boot.micrometer.tracing.autoconfigure.otlp.OtlpTracingConnectionDetails[]
|
||||
| Containers named "otel/opentelemetry-collector-contrib", "grafana/otel-lgtm"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.pulsar.PulsarConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.pulsar.autoconfigure.PulsarConnectionDetails[]
|
||||
| Containers named "apachepulsar/pulsar"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.r2dbc.autoconfigure.R2dbcConnectionDetails[]
|
||||
| Containers named "clickhouse/clickhouse-server", "gvenzl/oracle-free", "gvenzl/oracle-xe", "mariadb", "mssql/server", "mysql", or "postgres"
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.amqp.autoconfigure.RabbitConnectionDetails[]
|
||||
| Containers named "rabbitmq"
|
||||
|
||||
| javadoc:org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails[]
|
||||
|
|
|
@ -44,7 +44,7 @@ Furthermore, auto-configuration classes should not enable component scanning to
|
|||
Specific javadoc:org.springframework.context.annotation.Import[format=annotation] annotations should be used instead.
|
||||
|
||||
If your configuration needs to be applied in a specific order, you can use the `before`, `beforeName`, `after` and `afterName` attributes on the javadoc:org.springframework.boot.autoconfigure.AutoConfiguration[format=annotation] annotation or the dedicated javadoc:org.springframework.boot.autoconfigure.AutoConfigureBefore[format=annotation] and javadoc:org.springframework.boot.autoconfigure.AutoConfigureAfter[format=annotation] annotations.
|
||||
For example, if you provide web-specific configuration, your class may need to be applied after javadoc:org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration[].
|
||||
For example, if you provide web-specific configuration, your class may need to be applied after javadoc:org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration[].
|
||||
|
||||
If you want to order certain auto-configurations that should not have any direct knowledge of each other, you can also use javadoc:org.springframework.boot.autoconfigure.AutoConfigureOrder[format=annotation].
|
||||
That annotation has the same semantic as the regular javadoc:org.springframework.core.annotation.Order[format=annotation] annotation but provides a dedicated order for auto-configuration classes.
|
||||
|
|
|
@ -59,7 +59,7 @@ The registration is performed by Spring Boot's javadoc:org.springframework.boot.
|
|||
Auto-configuration for Gson is provided.
|
||||
When Gson is on the classpath a javadoc:com.google.gson.Gson[] bean is automatically configured.
|
||||
Several `+spring.gson.*+` configuration properties are provided for customizing the configuration.
|
||||
To take more control, one or more javadoc:org.springframework.boot.autoconfigure.gson.GsonBuilderCustomizer[] beans can be used.
|
||||
To take more control, one or more javadoc:org.springframework.boot.gson.autoconfigure.GsonBuilderCustomizer[] beans can be used.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ TIP: Use the `spring-boot-starter-cache` starter to quickly add basic caching de
|
|||
The starter brings in `spring-context-support`.
|
||||
If you add dependencies manually, you must include `spring-context-support` in order to use the JCache or Caffeine support.
|
||||
|
||||
If the javadoc:org.springframework.cache.CacheManager[] is auto-configured by Spring Boot, you can further tune its configuration before it is fully initialized by exposing a bean that implements the javadoc:org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer[] interface.
|
||||
If the javadoc:org.springframework.cache.CacheManager[] is auto-configured by Spring Boot, you can further tune its configuration before it is fully initialized by exposing a bean that implements the javadoc:org.springframework.boot.cache.autoconfigure.CacheManagerCustomizer[] interface.
|
||||
The following example sets a flag to say that `null` values should not be passed down to the underlying map:
|
||||
|
||||
include-code::MyCacheManagerConfiguration[]
|
||||
|
@ -105,7 +105,7 @@ There are two ways to customize the underlying javadoc:javax.cache.CacheManager[
|
|||
|
||||
* Caches can be created on startup by setting the configprop:spring.cache.cache-names[] property.
|
||||
If a custom javadoc:javax.cache.configuration.Configuration[] bean is defined, it is used to customize them.
|
||||
* javadoc:org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer[] beans are invoked with the reference of the javadoc:javax.cache.CacheManager[] for full customization.
|
||||
* javadoc:org.springframework.boot.cache.autoconfigure.CacheManagerCustomizer[] beans are invoked with the reference of the javadoc:javax.cache.CacheManager[] for full customization.
|
||||
|
||||
TIP: If a standard javadoc:javax.cache.CacheManager[] bean is defined, it is wrapped automatically in an javadoc:org.springframework.cache.CacheManager[] implementation that the abstraction expects.
|
||||
No further customization is applied to it.
|
||||
|
@ -164,7 +164,7 @@ spring:
|
|||
expiration: "10m"
|
||||
----
|
||||
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.autoconfigure.cache.CouchbaseCacheManagerBuilderCustomizer[] bean.
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.cache.autoconfigure.CouchbaseCacheManagerBuilderCustomizer[] bean.
|
||||
The following example shows a customizer that configures a specific entry expiration for `cache1` and `cache2`:
|
||||
|
||||
include-code::MyCouchbaseCacheManagerConfiguration[]
|
||||
|
@ -193,7 +193,7 @@ We strongly recommend keeping this setting enabled if you create your own javado
|
|||
TIP: You can take full control of the default configuration by adding a javadoc:org.springframework.data.redis.cache.RedisCacheConfiguration[] javadoc:org.springframework.context.annotation.Bean[format=annotation] of your own.
|
||||
This can be useful if you need to customize the default serialization strategy.
|
||||
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer[] bean.
|
||||
If you need more control over the configuration, consider registering a javadoc:org.springframework.boot.cache.autoconfigure.RedisCacheManagerBuilderCustomizer[] bean.
|
||||
The following example shows a customizer that configures a specific time to live for `cache1` and `cache2`:
|
||||
|
||||
include-code::MyRedisCacheManagerConfiguration[]
|
||||
|
@ -235,7 +235,7 @@ https://cache2k.org/[Cache2k] is an in-memory cache.
|
|||
If the Cache2k spring integration is present, a `SpringCache2kCacheManager` is auto-configured.
|
||||
|
||||
Caches can be created on startup by setting the configprop:spring.cache.cache-names[] property.
|
||||
Cache defaults can be customized using a javadoc:org.springframework.boot.autoconfigure.cache.Cache2kBuilderCustomizer[] bean.
|
||||
Cache defaults can be customized using a javadoc:org.springframework.boot.cache.autoconfigure.Cache2kBuilderCustomizer[] bean.
|
||||
The following example shows a customizer that configures the capacity of the cache to 200 entries, with an expiration of 5 minutes:
|
||||
|
||||
include-code::MyCache2kDefaultsConfiguration[]
|
||||
|
|
|
@ -29,7 +29,7 @@ We also check if the `hazelcast.config` system property is set.
|
|||
See the https://docs.hazelcast.org/docs/latest/manual/html-single/[Hazelcast documentation] for more details.
|
||||
|
||||
TIP: By default, javadoc:com.hazelcast.spring.context.SpringAware[format=annotation] on Hazelcast components is supported.
|
||||
The javadoc:com.hazelcast.core.ManagedContext[] can be overridden by declaring a javadoc:org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigCustomizer[] bean with an javadoc:org.springframework.core.annotation.Order[format=annotation] higher than zero.
|
||||
The javadoc:com.hazelcast.core.ManagedContext[] can be overridden by declaring a javadoc:org.springframework.boot.hazelcast.autoconfigure.HazelcastConfigCustomizer[] bean with an javadoc:org.springframework.core.annotation.Order[format=annotation] higher than zero.
|
||||
|
||||
NOTE: Spring Boot also has xref:io/caching.adoc#io.caching.provider.hazelcast[explicit caching support for Hazelcast].
|
||||
If caching is enabled, the javadoc:com.hazelcast.core.HazelcastInstance[] is automatically wrapped in a javadoc:org.springframework.cache.CacheManager[] implementation.
|
||||
|
|
|
@ -79,7 +79,7 @@ spring:
|
|||
redirects: dont-follow
|
||||
----
|
||||
|
||||
For more complex customizations, you can use javadoc:org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorBuilderCustomizer[] or declare your own javadoc:org.springframework.boot.http.client.reactive.ClientHttpConnectorBuilder[] bean which will cause auto-configuration to back off.
|
||||
For more complex customizations, you can use javadoc:org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorBuilderCustomizer[] or declare your own javadoc:org.springframework.boot.http.client.reactive.ClientHttpConnectorBuilder[] bean which will cause auto-configuration to back off.
|
||||
This can be useful when you need to customize some of the internals of the underlying HTTP library.
|
||||
|
||||
For example, the following will use a JDK client configured with a specific javadoc:java.net.ProxySelector[]:
|
||||
|
@ -108,9 +108,9 @@ In that case, no auto-configuration or javadoc:org.springframework.boot.web.reac
|
|||
[[io.rest-client.webclient.ssl]]
|
||||
=== WebClient SSL Support
|
||||
|
||||
If you need custom SSL configuration on the javadoc:org.springframework.http.client.reactive.ClientHttpConnector[] used by the javadoc:org.springframework.web.reactive.function.client.WebClient[], you can inject a javadoc:org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl[] instance that can be used with the builder's `apply` method.
|
||||
If you need custom SSL configuration on the javadoc:org.springframework.http.client.reactive.ClientHttpConnector[] used by the javadoc:org.springframework.web.reactive.function.client.WebClient[], you can inject a javadoc:org.springframework.boot.webclient.autoconfigure.WebClientSsl[] instance that can be used with the builder's `apply` method.
|
||||
|
||||
The javadoc:org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl[] interface provides access to any xref:features/ssl.adoc#features.ssl.bundles[SSL bundles] that you have defined in your `application.properties` or `application.yaml` file.
|
||||
The javadoc:org.springframework.boot.webclient.autoconfigure.WebClientSsl[] interface provides access to any xref:features/ssl.adoc#features.ssl.bundles[SSL bundles] that you have defined in your `application.properties` or `application.yaml` file.
|
||||
|
||||
The following code shows a typical example:
|
||||
|
||||
|
@ -206,7 +206,7 @@ include-code::MyRestTemplateCustomizer[]
|
|||
|
||||
Finally, you can define your own javadoc:org.springframework.boot.web.client.RestTemplateBuilder[] bean.
|
||||
Doing so will replace the auto-configured builder.
|
||||
If you want any javadoc:org.springframework.boot.web.client.RestTemplateCustomizer[] beans to be applied to your custom builder, as the auto-configuration would have done, configure it using a javadoc:org.springframework.boot.autoconfigure.web.client.RestTemplateBuilderConfigurer[].
|
||||
If you want any javadoc:org.springframework.boot.web.client.RestTemplateCustomizer[] beans to be applied to your custom builder, as the auto-configuration would have done, configure it using a javadoc:org.springframework.boot.restclient.autoconfigure.RestTemplateBuilderConfigurer[].
|
||||
The following example exposes a javadoc:org.springframework.boot.web.client.RestTemplateBuilder[] that matches what Spring Boot's auto-configuration would have done, except that custom connect and read timeouts are also specified:
|
||||
|
||||
include-code::MyRestTemplateBuilderConfiguration[]
|
||||
|
@ -270,7 +270,7 @@ spring:
|
|||
redirects: dont-follow
|
||||
----
|
||||
|
||||
For more complex customizations, you can use javadoc:org.springframework.boot.autoconfigure.http.client.ClientHttpRequestFactoryBuilderCustomizer[] or declare your own javadoc:org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder[] bean which will cause auto-configuration to back off.
|
||||
For more complex customizations, you can use javadoc:org.springframework.boot.http.client.autoconfigure.ClientHttpRequestFactoryBuilderCustomizer[] or declare your own javadoc:org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder[] bean which will cause auto-configuration to back off.
|
||||
This can be useful when you need to customize some of the internals of the underlying HTTP library.
|
||||
|
||||
For example, the following will use a JDK client configured with a specific javadoc:java.net.ProxySelector[]:
|
||||
|
|
|
@ -30,7 +30,7 @@ Spring Batch can then be configured using the `@Enable*JobRepository` annotation
|
|||
[[io.spring-batch.running-jobs-on-startup]]
|
||||
== Running Spring Batch Jobs on Startup
|
||||
|
||||
When Spring Boot auto-configures Spring Batch, and if a single javadoc:org.springframework.batch.core.Job[] bean is found in the application context, it is executed on startup (see javadoc:org.springframework.boot.autoconfigure.batch.JobLauncherApplicationRunner[] for details).
|
||||
When Spring Boot auto-configures Spring Batch, and if a single javadoc:org.springframework.batch.core.Job[] bean is found in the application context, it is executed on startup (see javadoc:org.springframework.boot.batch.autoconfigure.JobLauncherApplicationRunner[] for details).
|
||||
If multiple javadoc:org.springframework.batch.core.Job[] beans are found, the job that should be executed must be specified using configprop:spring.batch.job.name[].
|
||||
|
||||
You can disable running a javadoc:org.springframework.batch.core.Job[] found in the application context, as shown in the following example:
|
||||
|
|
|
@ -13,5 +13,5 @@ The application's javadoc:org.springframework.context.MessageSource[] is used wh
|
|||
This allows you to use xref:features/internationalization.adoc[your application's `messages.properties` files] for Bean Validation messages.
|
||||
Once the parameters have been resolved, message interpolation is completed using Bean Validation's default interpolator.
|
||||
|
||||
To customize the javadoc:jakarta.validation.Configuration[] used to build the javadoc:jakarta.validation.ValidatorFactory[], define a javadoc:org.springframework.boot.autoconfigure.validation.ValidationConfigurationCustomizer[] bean.
|
||||
To customize the javadoc:jakarta.validation.Configuration[] used to build the javadoc:jakarta.validation.ValidatorFactory[], define a javadoc:org.springframework.boot.validation.autoconfigure.ValidationConfigurationCustomizer[] bean.
|
||||
When multiple customizer beans are defined, they are called in order based on their javadoc:org.springframework.core.annotation.Order[format=annotation] annotation or javadoc:org.springframework.core.Ordered[] implementation.
|
||||
|
|
|
@ -38,12 +38,12 @@ spring:
|
|||
NOTE: When specifying addresses that way, the `host` and `port` properties are ignored.
|
||||
If the address uses the `amqps` protocol, SSL support is enabled automatically.
|
||||
|
||||
See javadoc:org.springframework.boot.autoconfigure.amqp.RabbitProperties[] for more of the supported property-based configuration options.
|
||||
To configure lower-level details of the RabbitMQ javadoc:com.rabbitmq.client.ConnectionFactory[] that is used by Spring AMQP, define a javadoc:org.springframework.boot.autoconfigure.amqp.ConnectionFactoryCustomizer[] bean.
|
||||
See javadoc:org.springframework.boot.amqp.autoconfigure.RabbitProperties[] for more of the supported property-based configuration options.
|
||||
To configure lower-level details of the RabbitMQ javadoc:com.rabbitmq.client.ConnectionFactory[] that is used by Spring AMQP, define a javadoc:org.springframework.boot.amqp.autoconfigure.ConnectionFactoryCustomizer[] bean.
|
||||
|
||||
If a javadoc:org.springframework.amqp.rabbit.connection.ConnectionNameStrategy[] bean exists in the context, it will be automatically used to name connections created by the auto-configured javadoc:org.springframework.amqp.rabbit.connection.CachingConnectionFactory[].
|
||||
|
||||
To make an application-wide, additive customization to the javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[], use a javadoc:org.springframework.boot.autoconfigure.amqp.RabbitTemplateCustomizer[] bean.
|
||||
To make an application-wide, additive customization to the javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[], use a javadoc:org.springframework.boot.amqp.autoconfigure.RabbitTemplateCustomizer[] bean.
|
||||
|
||||
TIP: See https://spring.io/blog/2010/06/14/understanding-amqp-the-protocol-used-by-rabbitmq/[Understanding AMQP, the protocol used by RabbitMQ] for more details.
|
||||
|
||||
|
@ -74,9 +74,9 @@ spring:
|
|||
----
|
||||
|
||||
Retries are disabled by default.
|
||||
You can also customize the javadoc:org.springframework.core.retry.RetryTemplate[] programmatically by declaring a javadoc:org.springframework.boot.autoconfigure.amqp.RabbitTemplateRetrySettingsCustomizer[] bean.
|
||||
You can also customize the javadoc:org.springframework.core.retry.RetryTemplate[] programmatically by declaring a javadoc:org.springframework.boot.amqp.autoconfigure.RabbitTemplateRetrySettingsCustomizer[] bean.
|
||||
|
||||
If you need to create more javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.autoconfigure.amqp.RabbitTemplateConfigurer[] bean that you can use to initialize a javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[] with the same settings as the factories used by the auto-configuration.
|
||||
If you need to create more javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.amqp.autoconfigure.RabbitTemplateConfigurer[] bean that you can use to initialize a javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[] with the same settings as the factories used by the auto-configuration.
|
||||
|
||||
|
||||
|
||||
|
@ -95,7 +95,7 @@ spring:
|
|||
|
||||
If a javadoc:org.springframework.amqp.support.converter.MessageConverter[], javadoc:org.springframework.rabbit.stream.support.converter.StreamMessageConverter[], or javadoc:org.springframework.rabbit.stream.producer.ProducerCustomizer[] bean is defined, it is associated automatically to the auto-configured javadoc:org.springframework.rabbit.stream.producer.RabbitStreamTemplate[].
|
||||
|
||||
If you need to create more javadoc:org.springframework.rabbit.stream.producer.RabbitStreamTemplate[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.autoconfigure.amqp.RabbitStreamTemplateConfigurer[] bean that you can use to initialize a javadoc:org.springframework.rabbit.stream.producer.RabbitStreamTemplate[] with the same settings as the factories used by the auto-configuration.
|
||||
If you need to create more javadoc:org.springframework.rabbit.stream.producer.RabbitStreamTemplate[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.amqp.autoconfigure.RabbitStreamTemplateConfigurer[] bean that you can use to initialize a javadoc:org.springframework.rabbit.stream.producer.RabbitStreamTemplate[] with the same settings as the factories used by the auto-configuration.
|
||||
|
||||
|
||||
|
||||
|
@ -112,7 +112,7 @@ include-code::MyBean[]
|
|||
|
||||
TIP: See javadoc:org.springframework.amqp.rabbit.annotation.EnableRabbit[format=annotation] for more details.
|
||||
|
||||
If you need to create more javadoc:org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer[] and a javadoc:org.springframework.boot.autoconfigure.amqp.DirectRabbitListenerContainerFactoryConfigurer[] that you can use to initialize a javadoc:org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory[] and a javadoc:org.springframework.amqp.rabbit.config.DirectRabbitListenerContainerFactory[] with the same settings as the factories used by the auto-configuration.
|
||||
If you need to create more javadoc:org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory[] instances or if you want to override the default, Spring Boot provides a javadoc:org.springframework.boot.amqp.autoconfigure.SimpleRabbitListenerContainerFactoryConfigurer[] and a javadoc:org.springframework.boot.amqp.autoconfigure.DirectRabbitListenerContainerFactoryConfigurer[] that you can use to initialize a javadoc:org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory[] and a javadoc:org.springframework.amqp.rabbit.config.DirectRabbitListenerContainerFactory[] with the same settings as the factories used by the auto-configuration.
|
||||
|
||||
TIP: It does not matter which container type you chose.
|
||||
Those two beans are exposed by the auto-configuration.
|
||||
|
@ -129,7 +129,7 @@ You can enable retries to handle situations where your listener throws an except
|
|||
By default, javadoc:org.springframework.amqp.rabbit.retry.RejectAndDontRequeueRecoverer[] is used, but you can define a javadoc:org.springframework.amqp.rabbit.retry.MessageRecoverer[] of your own.
|
||||
When retries are exhausted, the message is rejected and either dropped or routed to a dead-letter exchange if the broker is configured to do so.
|
||||
By default, retries are disabled.
|
||||
You can also customize the javadoc:org.springframework.core.retry.RetryPolicy[] programmatically by declaring a javadoc:org.springframework.boot.autoconfigure.amqp.RabbitListenerRetrySettingsCustomizer[] bean.
|
||||
You can also customize the javadoc:org.springframework.core.retry.RetryPolicy[] programmatically by declaring a javadoc:org.springframework.boot.amqp.autoconfigure.RabbitListenerRetrySettingsCustomizer[] bean.
|
||||
|
||||
IMPORTANT: By default, if retries are disabled and the listener throws an exception, the delivery is retried indefinitely.
|
||||
You can modify this behavior in two ways: Set the `defaultRequeueRejected` property to `false` so that zero re-deliveries are attempted or throw an javadoc:org.springframework.amqp.AmqpRejectAndDontRequeueException[] to signal the message should be rejected.
|
||||
|
|
|
@ -65,8 +65,8 @@ spring:
|
|||
max-connections: 50
|
||||
----
|
||||
|
||||
TIP: See javadoc:org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties[] for more of the supported options.
|
||||
You can also register an arbitrary number of beans that implement javadoc:org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionFactoryCustomizer[] for more advanced customizations.
|
||||
TIP: See javadoc:org.springframework.boot.activemq.autoconfigure.ActiveMQProperties[] for more of the supported options.
|
||||
You can also register an arbitrary number of beans that implement javadoc:org.springframework.boot.activemq.autoconfigure.ActiveMQConnectionFactoryCustomizer[] for more advanced customizations.
|
||||
|
||||
By default, ActiveMQ "Classic" creates a destination if it does not yet exist so that destinations are resolved against their provided names.
|
||||
|
||||
|
@ -120,7 +120,7 @@ spring:
|
|||
max-connections: 50
|
||||
----
|
||||
|
||||
See javadoc:org.springframework.boot.autoconfigure.jms.artemis.ArtemisProperties[] for more supported options.
|
||||
See javadoc:org.springframework.boot.artemis.autoconfigure.ArtemisProperties[] for more supported options.
|
||||
|
||||
No JNDI lookup is involved, and destinations are resolved against their names, using either the `name` attribute in the ActiveMQ Artemis configuration or the names provided through configuration.
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ spring:
|
|||
TIP: To create a topic on startup, add a bean of type javadoc:org.apache.kafka.clients.admin.NewTopic[].
|
||||
If the topic already exists, the bean is ignored.
|
||||
|
||||
See javadoc:org.springframework.boot.autoconfigure.kafka.KafkaProperties[] for more supported options.
|
||||
See javadoc:org.springframework.boot.kafka.autoconfigure.KafkaProperties[] for more supported options.
|
||||
|
||||
|
||||
|
||||
|
@ -91,7 +91,7 @@ Most of these common properties can be overridden for one or more of the client
|
|||
Apache Kafka designates properties with an importance of HIGH, MEDIUM, or LOW.
|
||||
Spring Boot auto-configuration supports all HIGH importance properties, some selected MEDIUM and LOW properties, and any properties that do not have a default value.
|
||||
|
||||
Only a subset of the properties supported by Kafka are available directly through the javadoc:org.springframework.boot.autoconfigure.kafka.KafkaProperties[] class.
|
||||
Only a subset of the properties supported by Kafka are available directly through the javadoc:org.springframework.boot.kafka.autoconfigure.KafkaProperties[] class.
|
||||
If you wish to configure the individual client types with additional properties that are not directly supported, use the following properties:
|
||||
|
||||
[configprops,yaml]
|
||||
|
|
|
@ -241,5 +241,5 @@ The properties supported by auto-configuration are shown in the xref:appendix:ap
|
|||
Note that, for the most part, these properties (hyphenated or camelCase) map directly to the Apache Pulsar configuration properties.
|
||||
See the Apache Pulsar documentation for details.
|
||||
|
||||
Only a subset of the properties supported by Pulsar are available directly through the javadoc:org.springframework.boot.autoconfigure.pulsar.PulsarProperties[] class.
|
||||
Only a subset of the properties supported by Pulsar are available directly through the javadoc:org.springframework.boot.pulsar.autoconfigure.PulsarProperties[] class.
|
||||
If you wish to tune the auto-configured components with additional properties that are not directly supported, you can use the customizer supported by each aforementioned component.
|
||||
|
|
|
@ -46,4 +46,4 @@ spring:
|
|||
uri: "ws://example.org"
|
||||
----
|
||||
|
||||
See the {code-spring-boot-integration-src}/autoconfigure/IntegrationAutoConfiguration.java[`IntegrationAutoConfiguration`] and javadoc:org.springframework.boot.autoconfigure.integration.IntegrationProperties[] classes for more details.
|
||||
See the {code-spring-boot-integration-src}/autoconfigure/IntegrationAutoConfiguration.java[`IntegrationAutoConfiguration`] and javadoc:org.springframework.boot.integration.autoconfigure.IntegrationProperties[] classes for more details.
|
||||
|
|
|
@ -311,7 +311,7 @@ include-code::MyJsonAssertJTests[tag=*]
|
|||
== Auto-configured Spring MVC Tests
|
||||
|
||||
To test whether Spring MVC controllers are working as expected, use the javadoc:org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest[format=annotation] annotation from the `spring-boot-webmvc-test` module.
|
||||
javadoc:org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest[format=annotation] auto-configures the Spring MVC infrastructure and limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.web.bind.annotation.ControllerAdvice[format=annotation], javadoc:org.springframework.boot.jackson.JsonComponent[format=annotation], javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:jakarta.servlet.Filter[], javadoc:org.springframework.web.servlet.HandlerInterceptor[], javadoc:org.springframework.web.servlet.config.annotation.WebMvcConfigurer[], javadoc:org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations[], and javadoc:org.springframework.web.method.support.HandlerMethodArgumentResolver[].
|
||||
javadoc:org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest[format=annotation] auto-configures the Spring MVC infrastructure and limits scanned beans to javadoc:org.springframework.stereotype.Controller[format=annotation], javadoc:org.springframework.web.bind.annotation.ControllerAdvice[format=annotation], javadoc:org.springframework.boot.jackson.JsonComponent[format=annotation], javadoc:org.springframework.core.convert.converter.Converter[], javadoc:org.springframework.core.convert.converter.GenericConverter[], javadoc:jakarta.servlet.Filter[], javadoc:org.springframework.web.servlet.HandlerInterceptor[], javadoc:org.springframework.web.servlet.config.annotation.WebMvcConfigurer[], javadoc:org.springframework.boot.webmvc.autoconfigure.WebMvcRegistrations[], and javadoc:org.springframework.web.method.support.HandlerMethodArgumentResolver[].
|
||||
Regular javadoc:org.springframework.stereotype.Component[format=annotation] and javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans are not scanned when the javadoc:org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest[format=annotation] annotation is used.
|
||||
javadoc:org.springframework.boot.context.properties.EnableConfigurationProperties[format=annotation] can be used to include javadoc:org.springframework.boot.context.properties.ConfigurationProperties[format=annotation] beans.
|
||||
|
||||
|
|
|
@ -119,10 +119,10 @@ The following service connection factories are provided in the `spring-boot-test
|
|||
|===
|
||||
| Connection Details | Matched on
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.activemq.autoconfigure.ActiveMQConnectionDetails[]
|
||||
| Containers named "symptoma/activemq" or javadoc:org.testcontainers.activemq.ActiveMQContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jms.artemis.ArtemisConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.artemis.autoconfigure.ArtemisConnectionDetails[]
|
||||
| Containers of type javadoc:org.testcontainers.activemq.ArtemisContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.cassandra.autoconfigure.CassandraConnectionDetails[]
|
||||
|
@ -134,22 +134,22 @@ The following service connection factories are provided in the `spring-boot-test
|
|||
| javadoc:org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchConnectionDetails[]
|
||||
| Containers of type javadoc:org.testcontainers.elasticsearch.ElasticsearchContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.flyway.autoconfigure.FlywayConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-jdbc-javadoc}/org.testcontainers.containers.JdbcDatabaseContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-jdbc-javadoc}/org.testcontainers.containers.JdbcDatabaseContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails[]
|
||||
| Containers of type javadoc:org.testcontainers.kafka.KafkaContainer[], javadoc:org.testcontainers.kafka.ConfluentKafkaContainer[] or javadoc:org.testcontainers.redpanda.RedpandaContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails[]
|
||||
| Containers named "osixia/openldap" or of type javadoc:org.testcontainers.ldap.LLdapContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.liquibase.LiquibaseConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.liquibase.autoconfigure.LiquibaseConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-jdbc-javadoc}/org.testcontainers.containers.JdbcDatabaseContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.mongodb.autoconfigure.MongoConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-mongodb-javadoc}/org.testcontainers.containers.MongoDBContainer[] or javadoc:{url-testcontainers-mongodb-javadoc}/org.testcontainers.mongodb.MongoDBAtlasLocalContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.neo4j.autoconfigure.Neo4jConnectionDetails[]
|
||||
|
@ -164,16 +164,16 @@ The following service connection factories are provided in the `spring-boot-test
|
|||
| javadoc:org.springframework.boot.micrometer.tracing.autoconfigure.otlp.OtlpTracingConnectionDetails[]
|
||||
| Containers named "otel/opentelemetry-collector-contrib" or of type javadoc:org.testcontainers.grafana.LgtmStackContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.pulsar.PulsarConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.pulsar.autoconfigure.PulsarConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-pulsar-javadoc}/org.testcontainers.containers.PulsarContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.r2dbc.autoconfigure.R2dbcConnectionDetails[]
|
||||
| Containers of type
|
||||
javadoc:org.testcontainers.clickhouse.ClickHouseContainer[],
|
||||
javadoc:{url-testcontainers-mariadb-javadoc}/org.testcontainers.containers.MariaDBContainer[], javadoc:{url-testcontainers-mssqlserver-javadoc}/org.testcontainers.containers.MSSQLServerContainer[], javadoc:{url-testcontainers-mysql-javadoc}/org.testcontainers.containers.MySQLContainer[],
|
||||
javadoc:org.testcontainers.oracle.OracleContainer[OracleContainer (free)], javadoc:{url-testcontainers-oracle-xe-javadoc}/org.testcontainers.containers.OracleContainer[OracleContainer (XE)] or javadoc:{url-testcontainers-postgresql-javadoc}/org.testcontainers.containers.PostgreSQLContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails[]
|
||||
| javadoc:org.springframework.boot.amqp.autoconfigure.RabbitConnectionDetails[]
|
||||
| Containers of type javadoc:{url-testcontainers-rabbitmq-javadoc}/org.testcontainers.containers.RabbitMQContainer[]
|
||||
|
||||
| javadoc:org.springframework.boot.data.redis.autoconfigure.RedisConnectionDetails[]
|
||||
|
@ -186,7 +186,7 @@ javadoc:org.testcontainers.oracle.OracleContainer[OracleContainer (free)], javad
|
|||
[TIP]
|
||||
====
|
||||
By default all applicable connection details beans will be created for a given javadoc:org.testcontainers.containers.Container[].
|
||||
For example, a javadoc:{url-testcontainers-postgresql-javadoc}/org.testcontainers.containers.PostgreSQLContainer[] will create both javadoc:org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails[] and javadoc:org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails[].
|
||||
For example, a javadoc:{url-testcontainers-postgresql-javadoc}/org.testcontainers.containers.PostgreSQLContainer[] will create both javadoc:org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails[] and javadoc:org.springframework.boot.r2dbc.autoconfigure.R2dbcConnectionDetails[].
|
||||
|
||||
If you want to create only a subset of the applicable types, you can use the `type` attribute of javadoc:org.springframework.boot.testcontainers.service.connection.ServiceConnection[format=annotation].
|
||||
====
|
||||
|
|
|
@ -49,7 +49,7 @@ The auto-configuration adds the following features on top of Spring's defaults:
|
|||
|
||||
If you want to keep Spring Boot WebFlux features and you want to add additional {url-spring-framework-docs}/web/webflux/config.html[WebFlux configuration], you can add your own javadoc:org.springframework.context.annotation.Configuration[format=annotation] class of type javadoc:org.springframework.web.reactive.config.WebFluxConfigurer[] but *without* javadoc:org.springframework.web.reactive.config.EnableWebFlux[format=annotation].
|
||||
|
||||
If you want to add additional customization to the auto-configured javadoc:org.springframework.http.server.reactive.HttpHandler[], you can define beans of type javadoc:org.springframework.boot.autoconfigure.web.reactive.WebHttpHandlerBuilderCustomizer[] and use them to modify the javadoc:org.springframework.web.server.adapter.WebHttpHandlerBuilder[].
|
||||
If you want to add additional customization to the auto-configured javadoc:org.springframework.http.server.reactive.HttpHandler[], you can define beans of type javadoc:org.springframework.boot.webflux.autoconfigure.WebHttpHandlerBuilderCustomizer[] and use them to modify the javadoc:org.springframework.web.server.adapter.WebHttpHandlerBuilder[].
|
||||
|
||||
If you want to take complete control of Spring WebFlux, you can add your own javadoc:org.springframework.context.annotation.Configuration[format=annotation] annotated with javadoc:org.springframework.web.reactive.config.EnableWebFlux[format=annotation].
|
||||
|
||||
|
@ -202,11 +202,11 @@ The first step to customizing this feature often involves using the existing mec
|
|||
For that, you can add a bean of type javadoc:org.springframework.boot.web.reactive.error.ErrorAttributes[].
|
||||
|
||||
To change the error handling behavior, you can implement javadoc:org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler[] and register a bean definition of that type.
|
||||
Because an javadoc:org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler[] is quite low-level, Spring Boot also provides a convenient javadoc:org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler[] to let you handle errors in a WebFlux functional way, as shown in the following example:
|
||||
Because an javadoc:org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler[] is quite low-level, Spring Boot also provides a convenient javadoc:org.springframework.boot.webflux.autoconfigure.error.AbstractErrorWebExceptionHandler[] to let you handle errors in a WebFlux functional way, as shown in the following example:
|
||||
|
||||
include-code::MyErrorWebExceptionHandler[]
|
||||
|
||||
For a more complete picture, you can also subclass javadoc:org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler[] directly and override specific methods.
|
||||
For a more complete picture, you can also subclass javadoc:org.springframework.boot.webflux.autoconfigure.error.DefaultErrorWebExceptionHandler[] directly and override specific methods.
|
||||
|
||||
In some cases, errors handled at the controller level are not recorded by web observations or the xref:actuator/metrics.adoc#actuator.metrics.supported.spring-webflux[metrics infrastructure].
|
||||
Applications can ensure that such exceptions are recorded with the observations by {url-spring-framework-docs}/integration/observability.html#observability.http-server.reactive[setting the handled exception on the observation context].
|
||||
|
@ -332,7 +332,7 @@ Common server settings include:
|
|||
Spring Boot tries as much as possible to expose common settings, but this is not always possible.
|
||||
For those cases, dedicated namespaces such as `server.netty.*` offer server-specific customizations.
|
||||
|
||||
TIP: See the javadoc:org.springframework.boot.autoconfigure.web.ServerProperties[] class for a complete list.
|
||||
TIP: See the javadoc:org.springframework.boot.web.server.autoconfigure.ServerProperties[] class for a complete list.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ In addition to Spring MVC's defaults, the auto-configuration provides the follow
|
|||
|
||||
If you want to keep those Spring Boot MVC customizations and make more {url-spring-framework-docs}/web/webmvc.html[MVC customizations] (interceptors, formatters, view controllers, and other features), you can add your own javadoc:org.springframework.context.annotation.Configuration[format=annotation] class of type javadoc:org.springframework.web.servlet.config.annotation.WebMvcConfigurer[] but *without* javadoc:org.springframework.web.servlet.config.annotation.EnableWebMvc[format=annotation].
|
||||
|
||||
If you want to provide custom instances of javadoc:org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping[], javadoc:org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter[], or javadoc:org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver[], and still keep the Spring Boot MVC customizations, you can declare a bean of type javadoc:org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations[] and use it to provide custom instances of those components.
|
||||
If you want to provide custom instances of javadoc:org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping[], javadoc:org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter[], or javadoc:org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver[], and still keep the Spring Boot MVC customizations, you can declare a bean of type javadoc:org.springframework.boot.webmvc.autoconfigure.WebMvcRegistrations[] and use it to provide custom instances of those components.
|
||||
The custom instances will be subject to further initialization and configuration by Spring MVC.
|
||||
To participate in, and if desired, override that subsequent processing, a javadoc:org.springframework.web.servlet.config.annotation.WebMvcConfigurer[] should be used.
|
||||
|
||||
|
@ -346,9 +346,9 @@ See the xref:appendix:application-properties/index.adoc#appendix.application-pro
|
|||
|
||||
To replace the default behavior completely, you can implement javadoc:org.springframework.boot.web.servlet.error.ErrorController[] and register a bean definition of that type or add a bean of type javadoc:org.springframework.boot.web.servlet.error.ErrorAttributes[] to use the existing mechanism but replace the contents.
|
||||
|
||||
TIP: The javadoc:org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController[] can be used as a base class for a custom javadoc:org.springframework.boot.web.servlet.error.ErrorController[].
|
||||
TIP: The javadoc:org.springframework.boot.webmvc.autoconfigure.error.BasicErrorController[] can be used as a base class for a custom javadoc:org.springframework.boot.web.servlet.error.ErrorController[].
|
||||
This is particularly useful if you want to add a handler for a new content type (the default is to handle `text/html` specifically and provide a fallback for everything else).
|
||||
To do so, extend javadoc:org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController[], add a public method with a javadoc:org.springframework.web.bind.annotation.RequestMapping[format=annotation] that has a `produces` attribute, and create a bean of your new type.
|
||||
To do so, extend javadoc:org.springframework.boot.webmvc.autoconfigure.error.BasicErrorController[], add a public method with a javadoc:org.springframework.web.bind.annotation.RequestMapping[format=annotation] that has a `produces` attribute, and create a bean of your new type.
|
||||
|
||||
As of Spring Framework 6.0, {url-spring-framework-docs}/web/webmvc/mvc-ann-rest-exceptions.html[RFC 9457 Problem Details] is supported.
|
||||
Spring MVC can produce custom error messages with the `application/problem+json` media type, like:
|
||||
|
@ -414,7 +414,7 @@ src/
|
|||
+- <other templates>
|
||||
----
|
||||
|
||||
For more complex mappings, you can also add beans that implement the javadoc:org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver[] interface, as shown in the following example:
|
||||
For more complex mappings, you can also add beans that implement the javadoc:org.springframework.boot.webmvc.autoconfigure.error.ErrorViewResolver[] interface, as shown in the following example:
|
||||
|
||||
include-code::MyErrorViewResolver[]
|
||||
|
||||
|
@ -601,7 +601,7 @@ Spring Boot tries as much as possible to expose common settings, but this is not
|
|||
For those cases, dedicated namespaces offer server-specific customizations (see `server.tomcat`).
|
||||
For instance, xref:how-to:webserver.adoc#howto.webserver.configure-access-logs[access logs] can be configured with specific features of the embedded servlet container.
|
||||
|
||||
TIP: See the javadoc:org.springframework.boot.autoconfigure.web.ServerProperties[] class for a complete list.
|
||||
TIP: See the javadoc:org.springframework.boot.web.server.autoconfigure.ServerProperties[] class for a complete list.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ They use a JSON format with items categorized under either "`groups`" or "`prope
|
|||
{"groups": [
|
||||
{
|
||||
"name": "server",
|
||||
"type": "org.springframework.boot.autoconfigure.web.ServerProperties",
|
||||
"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
|
||||
"type": "org.springframework.boot.web.server.autoconfigure.ServerProperties",
|
||||
"sourceType": "org.springframework.boot.web.server.autoconfigure.ServerProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.jpa.hibernate",
|
||||
|
@ -23,12 +23,12 @@ They use a JSON format with items categorized under either "`groups`" or "`prope
|
|||
{
|
||||
"name": "server.port",
|
||||
"type": "java.lang.Integer",
|
||||
"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
|
||||
"sourceType": "org.springframework.boot.web.server.autoconfigure.ServerProperties"
|
||||
},
|
||||
{
|
||||
"name": "server.address",
|
||||
"type": "java.net.InetAddress",
|
||||
"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties"
|
||||
"sourceType": "org.springframework.boot.web.server.autoconfigure.ServerProperties"
|
||||
},
|
||||
{
|
||||
"name": "spring.jpa.hibernate.ddl-auto",
|
||||
|
|
Loading…
Reference in New Issue