Skip to content

Commit

Permalink
Update Spring Framework links
Browse files Browse the repository at this point in the history
Closes gh-36241
  • Loading branch information
mhalbritter committed Nov 10, 2023
1 parent 8ac2e3e commit d29f7a8
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 47 deletions.
5 changes: 5 additions & 0 deletions spring-boot-project/spring-boot-docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
}
doFirst {
def versionConstraints = dependencyVersions.versionConstraints
def toAntoraVersion = version -> {
String formatted = version.split("\\.").take(2).join('.')
return version.endsWith("-SNAPSHOT") ? formatted + "-SNAPSHOT" : formatted
}
def securityVersion = versionConstraints["org.springframework.security:spring-security-core"]
if (securityVersion.endsWith("-SNAPSHOT")) {
securityVersion = securityVersion.substring(0, securityVersion.length() - "-SNAPSHOT".length())
Expand All @@ -314,6 +318,7 @@ tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
"spring-data-r2dbc-version": versionConstraints["org.springframework.data:spring-data-r2dbc"],
"spring-data-rest-version": versionConstraints["org.springframework.data:spring-data-rest-core"],
"spring-framework-version": versionConstraints["org.springframework:spring-core"],
"spring-framework-version-antora": toAntoraVersion(versionConstraints["org.springframework:spring-core"]),
"spring-graphql-version": versionConstraints["org.springframework.graphql:spring-graphql"],
"spring-integration-version": versionConstraints["org.springframework.integration:spring-integration-core"],
"spring-kafka-version": versionConstraints["org.springframework.kafka:spring-kafka"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ Auto-configuration enables the instrumentation of all requests handled by Spring
By default, metrics are generated with the name, `http.server.requests`.
You can customize the name by setting the configprop:management.observations.http.server.requests.name[] property.

See the {spring-framework-docs}/integration.html#integration.observability.http-server.servlet[Spring Framework reference documentation for more information on produced observations].
See the {spring-framework-docs}/integration/observability.html#observability.http-server.servlet[Spring Framework reference documentation for more information on produced observations].

To add to the default tags, provide a `@Bean` that extends `DefaultServerRequestObservationConvention` from the `org.springframework.http.server.observation` package.
To replace the default tags, provide a `@Bean` that implements `ServerRequestObservationConvention`.
Expand All @@ -767,7 +767,7 @@ Auto-configuration enables the instrumentation of all requests handled by Spring
By default, metrics are generated with the name, `http.server.requests`.
You can customize the name by setting the configprop:management.observations.http.server.requests.name[] property.

See the {spring-framework-docs}/integration.html#integration.observability.http-server.reactive[Spring Framework reference documentation for more information on produced observations].
See the {spring-framework-docs}/integration/observability.html#observability.http-server.reactive[Spring Framework reference documentation for more information on produced observations].

To add to the default tags, provide a `@Bean` that extends `DefaultServerRequestObservationConvention` from the `org.springframework.http.server.reactive.observation` package.
To replace the default tags, provide a `@Bean` that implements `ServerRequestObservationConvention`.
Expand Down Expand Up @@ -822,7 +822,7 @@ You can also manually apply the customizers responsible for this instrumentation
By default, metrics are generated with the name, `http.client.requests`.
You can customize the name by setting the configprop:management.observations.http.client.requests.name[] property.

See the {spring-framework-docs}/integration.html#integration.observability.http-client[Spring Framework reference documentation for more information on produced observations].
See the {spring-framework-docs}/integration/observability.html#observability.http-client[Spring Framework reference documentation for more information on produced observations].

To customize the tags when using `RestTemplate`, provide a `@Bean` that implements `ClientRequestObservationConvention` from the `org.springframework.http.client.observation` package.
To customize the tags when using `WebClient`, provide a `@Bean` that implements `ClientRequestObservationConvention` from the `org.springframework.web.reactive.function.client` package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
:spring-data-rest-api: https://docs.spring.io/spring-data/rest/docs/{spring-data-rest-version}/api/org/springframework/data/rest
:spring-framework: https://spring.io/projects/spring-framework
:spring-framework-api: https://docs.spring.io/spring-framework/docs/{spring-framework-version}/javadoc-api/org/springframework
:spring-framework-docs: https://docs.spring.io/spring-framework/docs/{spring-framework-version}/reference/html
:spring-framework-docs: https://docs.spring.io/spring-framework/reference/{spring-framework-version-antora}
:spring-graphql: https://spring.io/projects/spring-graphql
:spring-graphql-api: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/api/
:spring-graphql-docs: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/reference/html/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[features.aop]]
== Aspect-Oriented Programming
Spring Boot provides auto-configuration for aspect-oriented programming (AOP).
You can learn more about AOP with Spring in the {spring-framework-docs}/core.html#aop[Spring Framework reference documentation].
You can learn more about AOP with Spring in the {spring-framework-docs}/core/aop-api.html[Spring Framework reference documentation].

By default, Spring Boot's auto-configuration configures Spring AOP to use CGLib proxies.
To use JDK proxies instead, set `configprop:spring.aop.proxy-target-class` to `false`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ This condition will not match for applications that are run with an embedded web

[[features.developing-auto-configuration.condition-annotations.spel-conditions]]
==== SpEL Expression Conditions
The `@ConditionalOnExpression` annotation lets configuration be included based on the result of a {spring-framework-docs}/core.html#expressions[SpEL expression].
The `@ConditionalOnExpression` annotation lets configuration be included based on the result of a {spring-framework-docs}/core/expressions.html[SpEL expression].

NOTE: Referencing a bean in the expression will cause that bean to be initialized very early in context refresh processing.
As a result, the bean won't be eligible for post-processing (such as configuration properties binding) and its state may be incomplete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
https://kotlinlang.org[Kotlin] is a statically-typed language targeting the JVM (and other platforms) which allows writing concise and elegant code while providing {kotlin-docs}java-interop.html[interoperability] with existing libraries written in Java.

Spring Boot provides Kotlin support by leveraging the support in other Spring projects such as Spring Framework, Spring Data, and Reactor.
See the {spring-framework-docs}/languages.html#kotlin[Spring Framework Kotlin support documentation] for more information.
See the {spring-framework-docs}/languages/kotlin.html[Spring Framework Kotlin support documentation] for more information.

The easiest way to start with Spring Boot and Kotlin is to follow https://spring.io/guides/tutorials/spring-boot-kotlin/[this comprehensive tutorial].
You can create new Kotlin projects by using https://start.spring.io/#!language=kotlin[start.spring.io].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Profile sections are supported anywhere within the `<configuration>` element.
Use the `name` attribute to specify which profile accepts the configuration.
The `<springProfile>` tag can contain a profile name (for example `staging`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[Spring Framework reference guide] for more details.
Check the {spring-framework-docs}/core/beans/environment.html#beans-definition-profiles-java[Spring Framework reference guide] for more details.
The following listing shows three sample profiles:

[source,xml,subs="verbatim",indent=0]
Expand Down Expand Up @@ -500,7 +500,7 @@ Profile sections are supported anywhere within the `<Configuration>` element.
Use the `name` attribute to specify which profile accepts the configuration.
The `<SpringProfile>` tag can contain a profile name (for example `staging`) or a profile expression.
A profile expression allows for more complicated profile logic to be expressed, for example `production & (eu-central | eu-west)`.
Check the {spring-framework-docs}/core.html#beans-definition-profiles-java[Spring Framework reference guide] for more details.
Check the {spring-framework-docs}/core/beans/environment.html#beans-definition-profiles-java[Spring Framework reference guide] for more details.
The following listing shows three sample profiles:

[source,xml,subs="verbatim",indent=0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,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` objects].
With {spring-framework-api}/core/metrics/ApplicationStartup.html[`ApplicationStartup`], Spring Framework {spring-framework-docs}/core/beans/context-introduction.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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To use the vintage engine, add a dependency on `junit-vintage-engine`, as shown
The `spring-boot-starter-test` "`Starter`" (in the `test` `scope`) contains the following provided libraries:

* https://junit.org/junit5/[JUnit 5]: The de-facto standard for unit testing Java applications.
* {spring-framework-docs}/testing.html#integration-testing[Spring Test] & Spring Boot Test: Utilities and integration test support for Spring Boot applications.
* {spring-framework-docs}/testing/integration.html[Spring Test] & Spring Boot Test: Utilities and integration test support for Spring Boot applications.
* https://assertj.github.io/doc/[AssertJ]: A fluent assertion library.
* https://github.com/hamcrest/JavaHamcrest[Hamcrest]: A library of matcher objects (also known as constraints or predicates).
* https://site.mockito.org/[Mockito]: A Java mocking framework.
Expand All @@ -59,7 +59,7 @@ It is useful to be able to perform integration testing without requiring deploym
The Spring Framework includes a dedicated test module for such integration testing.
You can declare a dependency directly to `org.springframework:spring-test` or use the `spring-boot-starter-test` "`Starter`" to pull it in transitively.

If you have not used the `spring-test` module before, you should start by reading the {spring-framework-docs}/testing.html#testing[relevant section] of the Spring Framework reference documentation.
If you have not used the `spring-test` module before, you should start by reading the {spring-framework-docs}/testing.html[relevant section] of the Spring Framework reference documentation.



Expand Down Expand Up @@ -198,13 +198,13 @@ include::code:MyApplicationArgumentTests[]
==== Testing With a Mock Environment
By default, `@SpringBootTest` does not start the server but instead sets up a mock environment for testing web endpoints.

With Spring MVC, we can query our web endpoints using {spring-framework-docs}/testing.html#spring-mvc-test-framework[`MockMvc`] or `WebTestClient`, as shown in the following example:
With Spring MVC, we can query our web endpoints using {spring-framework-docs}/testing/spring-mvc-test-framework.html[`MockMvc`] or `WebTestClient`, as shown in the following example:

include::code:MyMockMvcTests[]

TIP: If you want to focus only on the web layer and not start a complete `ApplicationContext`, consider <<features#features.testing.spring-boot-applications.spring-mvc-tests,using `@WebMvcTest` instead>>.

With Spring WebFlux endpoints, you can use {spring-framework-docs}/testing.html#webtestclient-tests[`WebTestClient`] as shown in the following example:
With Spring WebFlux endpoints, you can use {spring-framework-docs}/testing/webtestclient.html[`WebTestClient`] as shown in the following example:

include::code:MyMockWebTestClientTests[]

Expand All @@ -226,7 +226,7 @@ If you need to start a full running server, we recommend that you use random por
If you use `@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)`, an available port is picked at random each time your test runs.

The `@LocalServerPort` annotation can be used to <<howto#howto.webserver.discover-port,inject the actual port used>> into your test.
For convenience, tests that need to make REST calls to the started server can additionally `@Autowire` a {spring-framework-docs}/testing.html#webtestclient-tests[`WebTestClient`], which resolves relative links to the running server and comes with a dedicated API for verifying responses, as shown in the following example:
For convenience, tests that need to make REST calls to the started server can additionally `@Autowire` a {spring-framework-docs}/testing/webtestclient.html[`WebTestClient`], which resolves relative links to the running server and comes with a dedicated API for verifying responses, as shown in the following example:

include::code:MyRandomPortWebTestClientTests[]

Expand Down Expand Up @@ -419,7 +419,7 @@ TIP: If you need to register extra components, such as Jackson `Module`, you can

Often, `@WebFluxTest` is limited to a single controller and used in combination with the `@MockBean` annotation to provide mock implementations for required collaborators.

`@WebFluxTest` also auto-configures {spring-framework-docs}/testing.html#webtestclient[`WebTestClient`], which offers a powerful way to quickly test WebFlux controllers without needing to start a full HTTP server.
`@WebFluxTest` also auto-configures {spring-framework-docs}/testing/webtestclient.html[`WebTestClient`], which offers a powerful way to quickly test WebFlux controllers without needing to start a full HTTP server.

TIP: You can also auto-configure `WebTestClient` in a non-`@WebFluxTest` (such as `@SpringBootTest`) by annotating it with `@AutoConfigureWebTestClient`.
The following example shows a class that uses both `@WebFluxTest` and a `WebTestClient`:
Expand Down Expand Up @@ -558,7 +558,7 @@ Regular `@Component` and `@ConfigurationProperties` beans are not scanned when t
TIP: A list of the auto-configuration settings that are enabled by `@DataJpaTest` can be <<test-auto-configuration#appendix.test-auto-configuration,found in the appendix>>.

By default, data JPA tests are transactional and roll back at the end of each test.
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class as follows:

include::code:MyNonTransactionalTests[]
Expand Down Expand Up @@ -590,7 +590,7 @@ Regular `@Component` and `@ConfigurationProperties` beans are not scanned when t
TIP: A list of the auto-configurations that are enabled by `@JdbcTest` can be <<test-auto-configuration#appendix.test-auto-configuration,found in the appendix>>.

By default, JDBC tests are transactional and roll back at the end of each test.
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class, as follows:

include::code:MyTransactionalTests[]
Expand All @@ -610,7 +610,7 @@ Only `AbstractJdbcConfiguration` subclasses are scanned when the `@DataJdbcTest`
TIP: A list of the auto-configurations that are enabled by `@DataJdbcTest` can be <<test-auto-configuration#appendix.test-auto-configuration,found in the appendix>>.

By default, Data JDBC tests are transactional and roll back at the end of each test.
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole test class as <<features#features.testing.spring-boot-applications.autoconfigured-jdbc,shown in the JDBC example>>.

If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
Expand Down Expand Up @@ -686,7 +686,7 @@ The following example shows a typical setup for using Neo4J tests in Spring Boot
include::code:propagation/MyDataNeo4jTests[]

By default, Data Neo4j tests are transactional and roll back at the end of each test.
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
See the {spring-framework-docs}/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole class, as follows:

include::code:nopropagation/MyDataNeo4jTests[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ It tells Spring that any HTTP request with the `/` path should be mapped to the
The `@RestController` annotation tells Spring to render the resulting string directly back to the caller.

TIP: The `@RestController` and `@RequestMapping` annotations are Spring MVC annotations (they are not specific to Spring Boot).
See the {spring-framework-docs}/web.html#mvc[MVC section] in the Spring Reference Documentation for more details.
See the {spring-framework-docs}/web/webmvc.html[MVC section] in the Spring Reference Documentation for more details.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ There are also non-standard headers, like `X-Forwarded-Host`, `X-Forwarded-Port`
If the proxy adds the commonly used `X-Forwarded-For` and `X-Forwarded-Proto` headers, setting `server.forward-headers-strategy` to `NATIVE` is enough to support those.
With this option, the Web servers themselves natively support this feature; you can check their specific documentation to learn about specific behavior.

If this is not enough, Spring Framework provides a {spring-framework-docs}/web.html#filters-forwarded-headers[ForwardedHeaderFilter] for the servlet stack and a {spring-framework-docs}/web-reactive.html#webflux-forwarded-headers[ForwardedHeaderTransformer] for the reactive stack.
If this is not enough, Spring Framework provides a {spring-framework-docs}/web/webmvc/filters.html#filters-forwarded-headers[ForwardedHeaderFilter] for the servlet stack and a {spring-framework-docs}/web/webflux/reactive-spring.html#webflux-forwarded-headers[ForwardedHeaderTransformer] for the reactive stack.
You can use them in your application by setting configprop:server.forward-headers-strategy[] to `FRAMEWORK`.

TIP: If you are using Tomcat and terminating SSL at the proxy, configprop:server.tomcat.redirect-context-root[] should be set to `false`.
Expand Down
Loading

0 comments on commit d29f7a8

Please sign in to comment.