From a0c083619f4b1d9268d84a794bc950897371fbc9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Jul 2025 19:33:34 +0200 Subject: [PATCH 1/2] Consistent line breaks in reference documentation --- framework-docs/antora.yml | 2 +- framework-docs/modules/ROOT/pages/core.adoc | 11 ---- .../modules/ROOT/pages/core/aop-api.adoc | 4 -- .../ROOT/pages/core/aop-api/advice.adoc | 14 ----- .../ROOT/pages/core/aop-api/advised.adoc | 4 -- .../ROOT/pages/core/aop-api/advisor.adoc | 4 -- .../ROOT/pages/core/aop-api/autoproxy.adoc | 7 --- .../pages/core/aop-api/concise-proxy.adoc | 4 -- .../modules/ROOT/pages/core/aop-api/pfb.adoc | 10 --- .../ROOT/pages/core/aop-api/pointcuts.adoc | 12 ---- .../ROOT/pages/core/aop-api/targetsource.adoc | 8 --- .../modules/ROOT/pages/core/aop.adoc | 4 -- .../pages/core/aop/aspectj-programmatic.adoc | 4 -- .../ROOT/pages/core/aop/ataspectj.adoc | 3 - .../ROOT/pages/core/aop/ataspectj/advice.adoc | 2 - .../pages/core/aop/ataspectj/at-aspectj.adoc | 3 - .../pages/core/aop/ataspectj/example.adoc | 3 +- .../aop/ataspectj/instantiation-models.adoc | 3 - .../core/aop/ataspectj/introductions.adoc | 2 - .../pages/core/aop/ataspectj/pointcuts.adoc | 3 - .../modules/ROOT/pages/core/aop/choosing.adoc | 6 -- .../pages/core/aop/introduction-defn.adoc | 4 -- .../pages/core/aop/introduction-proxies.adoc | 8 +-- .../core/aop/introduction-spring-defn.adoc | 8 +-- .../ROOT/pages/core/aop/mixing-styles.adoc | 4 -- .../modules/ROOT/pages/core/aop/proxying.adoc | 2 - .../modules/ROOT/pages/core/aop/schema.adoc | 44 +++++-------- .../ROOT/pages/core/aop/using-aspectj.adoc | 29 +++------ .../modules/ROOT/pages/core/aot.adoc | 11 ++-- .../modules/ROOT/pages/core/appendix.adoc | 4 -- .../ROOT/pages/core/appendix/xml-custom.adoc | 14 ----- .../ROOT/pages/core/appendix/xsd-schemas.adoc | 31 ++------- .../modules/ROOT/pages/core/beans.adoc | 4 -- .../pages/core/beans/annotation-config.adoc | 3 - .../annotation-config/autowired-primary.adoc | 3 - .../autowired-qualifiers.adoc | 3 - .../beans/annotation-config/autowired.adoc | 3 - .../custom-autowire-configurer.adoc | 3 - .../generics-as-qualifiers.adoc | 3 - ...tconstruct-and-predestroy-annotations.adoc | 4 -- .../beans/annotation-config/resource.adoc | 1 - .../annotation-config/value-annotations.adoc | 2 - .../modules/ROOT/pages/core/beans/basics.adoc | 9 --- .../ROOT/pages/core/beans/beanfactory.adoc | 1 - .../core/beans/child-bean-definitions.adoc | 4 -- .../pages/core/beans/classpath-scanning.adoc | 12 ---- .../core/beans/context-introduction.adoc | 17 +---- .../core/beans/context-load-time-weaver.adoc | 7 +-- .../ROOT/pages/core/beans/definition.adoc | 13 +--- .../ROOT/pages/core/beans/dependencies.adoc | 3 - .../beans/dependencies/factory-autowire.adoc | 11 ++-- .../dependencies/factory-collaborators.adoc | 8 +-- .../beans/dependencies/factory-dependson.adoc | 3 - .../beans/dependencies/factory-lazy-init.adoc | 3 - .../factory-method-injection.adoc | 21 +++---- .../factory-properties-detailed.adoc | 25 ++++---- .../ROOT/pages/core/beans/environment.adoc | 12 ---- .../pages/core/beans/factory-extension.adoc | 10 --- .../ROOT/pages/core/beans/factory-nature.adoc | 20 ------ .../ROOT/pages/core/beans/factory-scopes.adoc | 26 -------- .../ROOT/pages/core/beans/introduction.adoc | 4 -- .../modules/ROOT/pages/core/beans/java.adoc | 1 - .../pages/core/beans/java/basic-concepts.adoc | 3 - .../core/beans/java/bean-annotation.adoc | 4 +- .../java/composing-configuration-classes.adoc | 1 - .../beans/java/configuration-annotation.adoc | 8 +-- .../beans/java/instantiating-container.adoc | 5 +- .../core/beans/standard-annotations.adoc | 6 -- .../ROOT/pages/core/databuffer-codec.adoc | 12 ---- .../modules/ROOT/pages/core/expressions.adoc | 1 - .../pages/core/expressions/evaluation.adoc | 6 -- .../modules/ROOT/pages/core/null-safety.adoc | 4 -- .../modules/ROOT/pages/core/resources.adoc | 45 +------------ .../modules/ROOT/pages/core/validation.adoc | 13 ++-- .../pages/core/validation/beans-beans.adoc | 4 -- .../pages/core/validation/beanvalidation.adoc | 14 +---- .../pages/core/validation/conversion.adoc | 4 -- .../ROOT/pages/core/validation/convert.adoc | 6 -- ...uring-formatting-globaldatetimeformat.adoc | 3 - .../ROOT/pages/core/validation/format.adoc | 10 +-- .../ROOT/pages/core/validation/validator.adoc | 3 - .../modules/ROOT/pages/data-access.adoc | 4 -- .../ROOT/pages/data-access/appendix.adoc | 6 -- .../modules/ROOT/pages/data-access/dao.adoc | 6 -- .../modules/ROOT/pages/data-access/jdbc.adoc | 3 - .../ROOT/pages/data-access/jdbc/advanced.adoc | 3 - .../pages/data-access/jdbc/choose-style.adoc | 3 - .../pages/data-access/jdbc/connections.adoc | 4 +- .../ROOT/pages/data-access/jdbc/core.adoc | 3 - .../jdbc/embedded-database-support.adoc | 3 - .../jdbc/initializing-datasource.adoc | 3 - .../ROOT/pages/data-access/jdbc/object.adoc | 3 - .../ROOT/pages/data-access/jdbc/packages.adoc | 13 ++-- .../data-access/jdbc/parameter-handling.adoc | 1 - .../ROOT/pages/data-access/jdbc/simple.adoc | 3 - .../modules/ROOT/pages/data-access/orm.adoc | 3 - .../ROOT/pages/data-access/orm/general.adoc | 3 - .../ROOT/pages/data-access/orm/hibernate.adoc | 3 - .../pages/data-access/orm/introduction.adoc | 6 +- .../ROOT/pages/data-access/orm/jpa.adoc | 4 -- .../modules/ROOT/pages/data-access/oxm.adoc | 28 ++------- .../modules/ROOT/pages/data-access/r2dbc.adoc | 10 +-- .../ROOT/pages/data-access/transaction.adoc | 3 - .../application-server-integration.adoc | 3 - .../data-access/transaction/declarative.adoc | 2 - .../transaction/declarative/annotations.adoc | 5 +- .../applying-more-than-just-tx-advice.adoc | 2 - .../transaction/declarative/aspectj.adoc | 20 +++--- .../transaction/declarative/diff-tx.adoc | 2 - .../declarative/first-example.adoc | 2 - .../transaction/declarative/rolling-back.adoc | 6 +- .../declarative/tx-decl-explained.adoc | 2 - .../declarative/tx-propagation.adoc | 8 ++- .../declarative/txadvice-settings.adoc | 2 - .../pages/data-access/transaction/event.adoc | 3 - .../data-access/transaction/motivation.adoc | 3 - .../data-access/transaction/programmatic.adoc | 6 +- .../data-access/transaction/resources.adoc | 4 -- .../solutions-to-common-problems.adoc | 3 - .../data-access/transaction/strategies.adoc | 3 - .../transaction/tx-decl-vs-prog.adoc | 3 - .../tx-resource-synchronization.adoc | 3 - .../modules/ROOT/pages/integration.adoc | 8 --- .../modules/ROOT/pages/integration/cache.adoc | 3 - .../pages/integration/cache/annotations.adoc | 16 +++-- .../integration/cache/declarative-xml.adoc | 3 - .../ROOT/pages/integration/cache/jsr-107.adoc | 3 - .../ROOT/pages/integration/cache/plug.adoc | 3 - .../integration/cache/specific-config.adoc | 1 - .../cache/store-configuration.adoc | 3 - .../pages/integration/cache/strategies.adoc | 11 ++-- .../modules/ROOT/pages/integration/cds.adoc | 2 + .../pages/integration/checkpoint-restore.adoc | 2 + .../modules/ROOT/pages/integration/email.adoc | 1 - .../modules/ROOT/pages/integration/jms.adoc | 16 ----- .../ROOT/pages/integration/jms/annotated.adoc | 3 - .../jms/jca-message-endpoint-manager.adoc | 3 - .../ROOT/pages/integration/jms/namespace.adoc | 1 - .../ROOT/pages/integration/jms/receiving.adoc | 7 ++- .../ROOT/pages/integration/jms/sending.adoc | 13 ++-- .../ROOT/pages/integration/jms/using.adoc | 3 - .../modules/ROOT/pages/integration/jmx.adoc | 3 - .../ROOT/pages/integration/jmx/exporting.adoc | 3 - .../ROOT/pages/integration/jmx/interface.adoc | 3 - .../ROOT/pages/integration/jmx/jsr160.adoc | 3 - .../ROOT/pages/integration/jmx/naming.adoc | 3 - .../pages/integration/jmx/notifications.adoc | 3 - .../ROOT/pages/integration/jmx/proxy.adoc | 3 - .../ROOT/pages/integration/jmx/resources.adoc | 1 - .../ROOT/pages/integration/observability.adoc | 6 +- .../ROOT/pages/integration/rest-clients.adoc | 12 +--- .../ROOT/pages/integration/scheduling.adoc | 1 - .../modules/ROOT/pages/languages.adoc | 5 -- .../modules/ROOT/pages/languages/dynamic.adoc | 63 ++++++------------- .../modules/ROOT/pages/languages/kotlin.adoc | 7 +-- .../pages/languages/kotlin/annotations.adoc | 1 - .../languages/kotlin/bean-definition-dsl.adoc | 4 -- .../languages/kotlin/classes-interfaces.adoc | 4 -- .../pages/languages/kotlin/coroutines.adoc | 11 +--- .../pages/languages/kotlin/extensions.adoc | 4 -- .../languages/kotlin/getting-started.adoc | 6 -- .../pages/languages/kotlin/null-safety.adoc | 4 -- .../pages/languages/kotlin/requirements.adoc | 4 -- .../pages/languages/kotlin/resources.adoc | 1 - .../languages/kotlin/spring-projects-in.adoc | 12 +--- .../ROOT/pages/languages/kotlin/web.adoc | 5 +- .../modules/ROOT/pages/overview.adoc | 10 --- .../modules/ROOT/pages/rsocket.adoc | 39 +----------- .../modules/ROOT/pages/testing.adoc | 10 --- .../ROOT/pages/testing/annotations.adoc | 1 - .../integration-junit-jupiter.adoc | 13 ++-- .../annotations/integration-junit4.adoc | 11 ++-- .../annotations/integration-spring.adoc | 1 - .../annotation-activeprofiles.adoc | 1 - .../annotation-aftertransaction.adoc | 2 - .../annotation-beforetransaction.adoc | 2 - .../annotation-bootstrapwith.adoc | 1 - .../integration-spring/annotation-commit.adoc | 2 - ...annotation-contextcustomizerfactories.adoc | 7 +-- .../annotation-contexthierarchy.adoc | 5 +- .../annotation-dirtiescontext.adoc | 1 - .../annotation-dynamicpropertysource.adoc | 4 +- .../annotation-mockitobean.adoc | 2 + .../annotation-recordapplicationevents.adoc | 1 - .../annotation-rollback.adoc | 2 - .../integration-spring/annotation-sql.adoc | 5 +- .../annotation-sqlconfig.adoc | 1 - .../annotation-sqlgroup.adoc | 3 - .../annotation-sqlmergemode.adoc | 2 - .../annotation-testexecutionlisteners.adoc | 11 ++-- .../annotation-testpropertysource.adoc | 4 +- .../annotation-webappconfiguration.adoc | 2 - .../annotations/integration-standard.adoc | 3 - .../modules/ROOT/pages/testing/appendix.adoc | 2 - .../ROOT/pages/testing/integration.adoc | 8 +-- .../modules/ROOT/pages/testing/mockmvc.adoc | 2 - .../ROOT/pages/testing/mockmvc/assertj.adoc | 2 +- .../testing/mockmvc/assertj/assertions.adoc | 1 + .../testing/mockmvc/assertj/integration.adoc | 2 - .../testing/mockmvc/assertj/requests.adoc | 3 +- .../ROOT/pages/testing/mockmvc/hamcrest.adoc | 2 +- .../mockmvc/hamcrest/async-requests.adoc | 2 - .../mockmvc/hamcrest/expectations.adoc | 1 - .../testing/mockmvc/hamcrest/filters.adoc | 2 - .../testing/mockmvc/hamcrest/requests.adoc | 1 - .../testing/mockmvc/hamcrest/setup-steps.adoc | 1 - .../pages/testing/mockmvc/hamcrest/setup.adoc | 4 +- .../mockmvc/hamcrest/static-imports.adoc | 2 - .../hamcrest/vs-streaming-response.adoc | 2 - .../ROOT/pages/testing/mockmvc/htmlunit.adoc | 1 - .../ROOT/pages/testing/mockmvc/overview.adoc | 2 - .../ROOT/pages/testing/mockmvc/resources.adoc | 2 - .../vs-end-to-end-integration-tests.adoc | 1 - .../pages/testing/spring-mvc-test-client.adoc | 1 + .../ROOT/pages/testing/support-jdbc.adoc | 1 + .../pages/testing/testcontext-framework.adoc | 7 +-- .../application-events.adoc | 1 - .../testcontext-framework/bootstrapping.adoc | 2 - .../testcontext-framework/ctx-management.adoc | 1 - .../testcontext-framework/executing-sql.adoc | 9 +-- .../testcontext-framework/fixture-di.adoc | 15 +++-- .../key-abstractions.adoc | 9 ++- .../parallel-test-execution.adoc | 1 - .../support-classes.adoc | 2 - .../testcontext-framework/tel-config.adoc | 4 ++ .../test-execution-events.adoc | 10 +-- .../testing/testcontext-framework/tx.adoc | 16 +++-- .../web-scoped-beans.adoc | 1 - .../modules/ROOT/pages/testing/unit.adoc | 13 +--- .../ROOT/pages/testing/webtestclient.adoc | 21 ------- .../modules/ROOT/pages/web-reactive.adoc | 8 +-- framework-docs/modules/ROOT/pages/web.adoc | 11 ++-- .../modules/ROOT/pages/web/integration.adoc | 19 +----- .../modules/ROOT/pages/web/webflux-cors.adoc | 12 ---- .../ROOT/pages/web/webflux-functional.adoc | 18 +----- .../web/webflux-http-interface-client.adoc | 1 - .../modules/ROOT/pages/web/webflux-test.adoc | 2 +- .../modules/ROOT/pages/web/webflux-view.adoc | 39 +++--------- .../ROOT/pages/web/webflux-webclient.adoc | 4 -- .../webflux-webclient/client-attributes.adoc | 2 - .../web/webflux-webclient/client-body.adoc | 5 -- .../web/webflux-webclient/client-builder.adoc | 9 +-- .../web/webflux-webclient/client-context.adoc | 3 - .../webflux-webclient/client-exchange.adoc | 4 -- .../webflux-webclient/client-retrieve.adoc | 4 -- .../webflux-webclient/client-synchronous.adoc | 4 -- .../ROOT/pages/web/webflux-websocket.adoc | 16 +---- .../modules/ROOT/pages/web/webflux.adoc | 4 -- .../web/webflux/ann-rest-exceptions.adoc | 9 --- .../ROOT/pages/web/webflux/caching.adoc | 7 +-- .../ROOT/pages/web/webflux/config.adoc | 20 ------ .../ROOT/pages/web/webflux/controller.adoc | 3 - .../web/webflux/controller/ann-advice.adoc | 1 - .../webflux/controller/ann-exceptions.adoc | 8 +-- .../webflux/controller/ann-initbinder.adoc | 1 - .../web/webflux/controller/ann-methods.adoc | 2 - .../controller/ann-methods/arguments.adoc | 2 - .../controller/ann-methods/cookievalue.adoc | 2 - .../controller/ann-methods/httpentity.adoc | 2 - .../controller/ann-methods/jackson.adoc | 4 +- .../ann-methods/matrix-variables.adoc | 2 - .../ann-methods/multipart-forms.adoc | 1 + .../controller/ann-methods/requestattrib.adoc | 2 - .../controller/ann-methods/requestbody.adoc | 1 - .../controller/ann-methods/requestheader.adoc | 2 - .../controller/ann-methods/requestparam.adoc | 2 - .../controller/ann-methods/responsebody.adoc | 11 ++-- .../ann-methods/responseentity.adoc | 5 +- .../controller/ann-methods/return-types.adoc | 11 ++-- .../ann-methods/sessionattribute.adoc | 2 - .../ann-methods/sessionattributes.adoc | 2 - .../ann-methods/typeconversion.adoc | 7 +-- .../controller/ann-modelattrib-methods.adoc | 9 +-- .../controller/ann-requestmapping.adoc | 5 +- .../pages/web/webflux/controller/ann.adoc | 5 -- .../pages/web/webflux/dispatcher-handler.adoc | 39 +++++------- .../ROOT/pages/web/webflux/new-framework.adoc | 31 +++------ .../pages/web/webflux/reactive-spring.adoc | 32 ++-------- .../ROOT/pages/web/webflux/security.adoc | 4 -- .../ROOT/pages/web/webflux/uri-building.adoc | 2 - .../modules/ROOT/pages/web/webmvc-client.adoc | 7 +-- .../modules/ROOT/pages/web/webmvc-cors.adoc | 16 ----- .../ROOT/pages/web/webmvc-functional.adoc | 22 ++----- .../modules/ROOT/pages/web/webmvc-view.adoc | 1 - .../pages/web/webmvc-view/mvc-document.adoc | 7 --- .../ROOT/pages/web/webmvc-view/mvc-feeds.adoc | 6 -- .../pages/web/webmvc-view/mvc-fragments.adoc | 2 +- .../pages/web/webmvc-view/mvc-freemarker.adoc | 11 ---- .../web/webmvc-view/mvc-groovymarkup.adoc | 6 -- .../pages/web/webmvc-view/mvc-jackson.adoc | 6 -- .../ROOT/pages/web/webmvc-view/mvc-jsp.adoc | 27 +------- .../pages/web/webmvc-view/mvc-script.adoc | 6 -- .../pages/web/webmvc-view/mvc-thymeleaf.adoc | 4 -- .../web/webmvc-view/mvc-xml-marshalling.adoc | 4 -- .../ROOT/pages/web/webmvc-view/mvc-xslt.adoc | 8 +-- .../modules/ROOT/pages/web/webmvc.adoc | 1 - .../ROOT/pages/web/webmvc/filters.adoc | 11 ---- .../pages/web/webmvc/message-converters.adoc | 2 - .../ROOT/pages/web/webmvc/mvc-ann-async.adoc | 20 +----- .../web/webmvc/mvc-ann-rest-exceptions.adoc | 7 --- .../ROOT/pages/web/webmvc/mvc-caching.adoc | 6 -- .../ROOT/pages/web/webmvc/mvc-config.adoc | 3 - .../web/webmvc/mvc-config/advanced-java.adoc | 3 - .../mvc-config/content-negotiation.adoc | 6 +- .../web/webmvc/mvc-config/conversion.adoc | 3 - .../web/webmvc/mvc-config/customize.adoc | 3 - .../pages/web/webmvc/mvc-config/enable.adoc | 3 - .../webmvc/mvc-config/static-resources.adoc | 3 - .../web/webmvc/mvc-config/validation.adoc | 3 - .../webmvc/mvc-config/view-controller.adoc | 3 - .../ROOT/pages/web/webmvc/mvc-controller.adoc | 3 - .../web/webmvc/mvc-controller/ann-advice.adoc | 4 -- .../mvc-controller/ann-exceptionhandler.adoc | 5 -- .../webmvc/mvc-controller/ann-initbinder.adoc | 3 +- .../webmvc/mvc-controller/ann-methods.adoc | 2 - .../mvc-controller/ann-methods/arguments.adoc | 2 - .../ann-methods/cookievalue.adoc | 2 - .../ann-methods/flash-attributes.adoc | 2 - .../ann-methods/httpentity.adoc | 3 - .../mvc-controller/ann-methods/jackson.adoc | 3 - .../ann-methods/matrix-variables.adoc | 2 - .../ann-methods/multipart-forms.adoc | 2 - .../ann-methods/redirecting-passing-data.adoc | 9 ++- .../ann-methods/requestattrib.adoc | 2 - .../ann-methods/requestbody.adoc | 7 +-- .../ann-methods/requestheader.adoc | 6 +- .../ann-methods/requestparam.adoc | 2 - .../ann-methods/responsebody.adoc | 9 ++- .../ann-methods/responseentity.adoc | 5 +- .../ann-methods/return-types.adoc | 2 - .../ann-methods/sessionattribute.adoc | 2 - .../ann-methods/sessionattributes.adoc | 2 - .../ann-methods/typeconversion.adoc | 2 - .../ann-modelattrib-methods.adoc | 3 - .../mvc-controller/ann-requestmapping.adoc | 13 ++-- .../pages/web/webmvc/mvc-controller/ann.adoc | 3 - .../ROOT/pages/web/webmvc/mvc-http2.adoc | 3 +- .../ROOT/pages/web/webmvc/mvc-security.adoc | 4 -- .../ROOT/pages/web/webmvc/mvc-servlet.adoc | 3 - .../pages/web/webmvc/mvc-uri-building.adoc | 7 --- .../modules/ROOT/pages/web/websocket.adoc | 2 - .../ROOT/pages/web/websocket/fallback.adoc | 22 ++----- .../ROOT/pages/web/websocket/server.adoc | 5 -- .../ROOT/pages/web/websocket/stomp.adoc | 3 - .../stomp/application-context-events.adoc | 3 - .../stomp/authentication-token-based.adoc | 3 - .../web/websocket/stomp/authentication.adoc | 3 - .../web/websocket/stomp/authorization.adoc | 3 - .../pages/web/websocket/stomp/benefits.adoc | 3 - .../pages/web/websocket/stomp/client.adoc | 3 - .../stomp/configuration-performance.adoc | 3 - .../stomp/destination-separator.adoc | 3 - .../pages/web/websocket/stomp/enable.adoc | 1 - .../websocket/stomp/handle-annotations.adoc | 3 - .../stomp/handle-broker-relay-configure.adoc | 3 - .../websocket/stomp/handle-broker-relay.adoc | 3 - .../web/websocket/stomp/handle-send.adoc | 3 - .../web/websocket/stomp/interceptors.adoc | 3 - .../web/websocket/stomp/message-flow.adoc | 3 - .../pages/web/websocket/stomp/overview.adoc | 3 - .../ROOT/pages/web/websocket/stomp/scope.adoc | 3 - .../ROOT/pages/web/websocket/stomp/stats.adoc | 3 - .../web/websocket/stomp/user-destination.adoc | 3 - .../ROOT/partials/web/forwarded-headers.adoc | 7 --- .../ROOT/partials/web/websocket-intro.adoc | 4 -- 365 files changed, 399 insertions(+), 1867 deletions(-) diff --git a/framework-docs/antora.yml b/framework-docs/antora.yml index 87f730b8574..c8c78a50db3 100644 --- a/framework-docs/antora.yml +++ b/framework-docs/antora.yml @@ -6,7 +6,7 @@ nav: ext: collector: run: - command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :framework-docs:generateAntoraResources + command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g" :framework-docs:generateAntoraResources local: true scan: dir: ./build/generated-antora-resources diff --git a/framework-docs/modules/ROOT/pages/core.adoc b/framework-docs/modules/ROOT/pages/core.adoc index 6803a4b8895..bea4d6e6856 100644 --- a/framework-docs/modules/ROOT/pages/core.adoc +++ b/framework-docs/modules/ROOT/pages/core.adoc @@ -17,14 +17,3 @@ is also provided. AOT processing can be used to optimize your application ahead-of-time. It is typically used for native image deployment using GraalVM. - - - - - - - - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api.adoc b/framework-docs/modules/ROOT/pages/core/aop-api.adoc index e159cf1867d..af94989a96b 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api.adoc @@ -6,7 +6,3 @@ The previous chapter described the Spring's support for AOP with @AspectJ and sc aspect definitions. In this chapter, we discuss the lower-level Spring AOP APIs. For common applications, we recommend the use of Spring AOP with AspectJ pointcuts as described in the previous chapter. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/advice.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/advice.adoc index 317af250fe9..81b99779216 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/advice.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/advice.adoc @@ -4,7 +4,6 @@ Now we can examine how Spring AOP handles advice. - [[aop-api-advice-lifecycle]] == Advice Lifecycles @@ -22,14 +21,12 @@ the advice adds state to the proxied object. You can use a mix of shared and per-instance advice in the same AOP proxy. - [[aop-api-advice-types]] == Advice Types in Spring Spring provides several advice types and is extensible to support arbitrary advice types. This section describes the basic concepts and standard advice types. - [[aop-api-advice-around]] === Interception Around Advice @@ -101,7 +98,6 @@ you are likely to want to run the aspect in another AOP framework. Note that poi are not currently interoperable between frameworks, and the AOP Alliance does not currently define pointcut interfaces. - [[aop-api-advice-before]] === Before Advice @@ -168,7 +164,6 @@ Kotlin:: TIP: Before advice can be used with any pointcut. - [[aop-api-advice-throws]] === Throws Advice @@ -297,7 +292,6 @@ exception that is incompatible with the target method's signature!_ TIP: Throws advice can be used with any pointcut. - [[aop-api-advice-after-returning]] === After Returning Advice @@ -361,7 +355,6 @@ thrown up the interceptor chain instead of the return value. TIP: After returning advice can be used with any pointcut. - [[aop-api-advice-introduction]] === Introduction Advice @@ -501,7 +494,6 @@ Java:: } return super.invoke(invocation); } - } ---- @@ -531,7 +523,6 @@ Kotlin:: } return super.invoke(invocation) } - } ---- ====== @@ -582,8 +573,3 @@ We can apply this advisor programmatically by using the `Advised.addAdvisor()` m (the recommended way) in XML configuration, as any other advisor. All proxy creation choices discussed below, including "`auto proxy creators,`" correctly handle introductions and stateful mixins. - - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/advised.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/advised.adoc index 639379c2e07..57f3fd54112 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/advised.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/advised.adoc @@ -142,7 +142,3 @@ case, the `Advised` `isFrozen()` method returns `true`, and any attempts to modi advice through addition or removal results in an `AopConfigException`. The ability to freeze the state of an advised object is useful in some cases (for example, to prevent calling code removing a security interceptor). - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/advisor.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/advisor.adoc index 2eac0521085..b65dbb2aa68 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/advisor.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/advisor.adoc @@ -14,7 +14,3 @@ It is possible to mix advisor and advice types in Spring in the same AOP proxy. example, you could use an interception around advice, throws advice, and before advice in one proxy configuration. Spring automatically creates the necessary interceptor chain. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/autoproxy.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/autoproxy.adoc index 60438bbc174..5e439dc0698 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/autoproxy.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/autoproxy.adoc @@ -19,14 +19,12 @@ There are two ways to do this: auto-proxy creation driven by source-level metadata attributes. - [[aop-autoproxy-choices]] == Auto-proxy Bean Definitions This section covers the auto-proxy creators provided by the `org.springframework.aop.framework.autoproxy` package. - [[aop-api-autoproxy]] === `BeanNameAutoProxyCreator` @@ -61,7 +59,6 @@ automatically created by the `BeanNameAutoProxyCreator`. The same advice is appl to all matching beans. Note that, if advisors are used (rather than the interceptor in the preceding example), the pointcuts may apply differently to different beans. - [[aop-api-autoproxy-default]] === `DefaultAdvisorAutoProxyCreator` @@ -125,7 +122,3 @@ differently configured, AdvisorAutoProxyCreators in the same factory) and orderi Advisors can implement the `org.springframework.core.Ordered` interface to ensure correct ordering if this is an issue. The `TransactionAttributeSourceAdvisor` used in the preceding example has a configurable order value. The default setting is unordered. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/concise-proxy.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/concise-proxy.adoc index a0218c76308..f9d2f80de30 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/concise-proxy.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/concise-proxy.adoc @@ -65,7 +65,3 @@ that, if you have a (parent) bean definition that you intend to use only as a te and this definition specifies a class, you must make sure to set the `abstract` attribute to `true`. Otherwise, the application context actually tries to pre-instantiate it. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/pfb.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/pfb.adoc index 7c15b2de343..701eef3f5f6 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/pfb.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/pfb.adoc @@ -14,7 +14,6 @@ the pointcuts, any advice that applies, and their ordering. However, there are s options that are preferable if you do not need such control. - [[aop-pfb-1]] == Basics @@ -32,7 +31,6 @@ application objects (besides the target, which should be available in any AOP framework), benefiting from all the pluggability provided by Dependency Injection. - [[aop-pfb-2]] == JavaBean Properties @@ -87,7 +85,6 @@ to be applied. You can find an example of using this feature in xref:core/aop-ap `false`. - [[aop-pfb-proxy-types]] == JDK- and CGLIB-based proxies @@ -137,7 +134,6 @@ interface that the target class implements to the `proxyInterfaces` property. Ho it is significantly less work and less prone to typographical errors. - [[aop-api-proxying-intf]] == Proxying Interfaces @@ -263,7 +259,6 @@ However, there are times when being able to obtain the un-advised target from th factory might actually be an advantage (for example, in certain test scenarios). - [[aop-api-proxying-class]] == Proxying Classes @@ -302,7 +297,6 @@ There is little performance difference between CGLIB proxies and dynamic proxies Performance should not be a decisive consideration in this case. - [[aop-global-advisors]] == Using "`Global`" Advisors @@ -325,7 +319,3 @@ two global advisors: ---- - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/pointcuts.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/pointcuts.adoc index 274e9f5e1f7..3399fc540f1 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/pointcuts.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/pointcuts.adoc @@ -4,7 +4,6 @@ This section describes how Spring handles the crucial pointcut concept. - [[aop-api-concepts]] == Concepts @@ -69,7 +68,6 @@ TIP: If possible, try to make pointcuts static, allowing the AOP framework to ca results of pointcut evaluation when an AOP proxy is created. - [[aop-api-pointcut-ops]] == Operations on Pointcuts @@ -84,7 +82,6 @@ You can compose pointcuts by using the static methods in the expressions is usually a simpler approach. - [[aop-api-pointcuts-aspectj]] == AspectJ Expression Pointcuts @@ -95,14 +92,12 @@ uses an AspectJ-supplied library to parse an AspectJ pointcut expression string. See the xref:core/aop.adoc[previous chapter] for a discussion of supported AspectJ pointcut primitives. - [[aop-api-pointcuts-impls]] == Convenience Pointcut Implementations Spring provides several convenient pointcut implementations. You can use some of them directly; others are intended to be subclassed in application-specific pointcuts. - [[aop-api-pointcuts-static]] === Static Pointcuts @@ -146,7 +141,6 @@ You can use `RegexpMethodPointcutAdvisor` with any `Advice` type. An important type of static pointcut is a metadata-driven pointcut. This uses the values of metadata attributes (typically, source-level metadata). - [[aop-api-pointcuts-dynamic]] === Dynamic pointcuts @@ -172,7 +166,6 @@ other dynamic pointcuts. In Java 1.4, the cost is about five times that of other pointcuts. - [[aop-api-pointcuts-superclasses]] == Pointcut Superclasses @@ -214,7 +207,6 @@ There are also superclasses for dynamic pointcuts. You can use custom pointcuts with any advice type. - [[aop-api-pointcuts-custom]] == Custom Pointcuts @@ -225,7 +217,3 @@ expression language, if you can. NOTE: Later versions of Spring may offer support for "`semantic pointcuts`" as offered by JAC -- for example, "`all methods that change instance variables in the target object.`" - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc index 2be131981c0..4a01901853c 100644 --- a/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop-api/targetsource.adoc @@ -22,7 +22,6 @@ rather than a singleton bean definition. This allows Spring to create a new targ instance when required. - [[aop-ts-swap]] == Hot-swappable Target Sources @@ -77,7 +76,6 @@ use a `TargetSource`), any `TargetSource` can be used in conjunction with arbitrary advice. - [[aop-ts-pool]] == Pooling Target Sources @@ -175,7 +173,6 @@ Simpler pooling is available by using auto-proxying. You can set the `TargetSour used by any auto-proxy creator. - [[aop-ts-prototype]] == Prototype Target Sources @@ -200,7 +197,6 @@ The only property is the name of the target bean. Inheritance is used in the source, the target bean must be a prototype bean definition. - [[aop-ts-threadlocal]] == `ThreadLocal` Target Sources @@ -226,7 +222,3 @@ always remember to correctly set and unset (where the latter involves a call to any case, since not unsetting it might result in problematic behavior. Spring's `ThreadLocal` support does this for you and should always be considered in favor of using `ThreadLocal` instances without other proper handling code. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop.adoc b/framework-docs/modules/ROOT/pages/core/aop.adoc index 3d86b381f32..f037e736cb1 100644 --- a/framework-docs/modules/ROOT/pages/core/aop.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop.adoc @@ -32,7 +32,3 @@ AOP is used in the Spring Framework to: NOTE: If you are interested only in generic declarative services or other pre-packaged declarative middleware services such as pooling, you do not need to work directly with Spring AOP, and can skip most of this chapter. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/aspectj-programmatic.adoc b/framework-docs/modules/ROOT/pages/core/aop/aspectj-programmatic.adoc index cb92225b78a..b7fde6aa6a0 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/aspectj-programmatic.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/aspectj-programmatic.adoc @@ -53,7 +53,3 @@ Kotlin:: ====== See the {spring-framework-api}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj.adoc index 4380293f2f1..c2862871a44 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj.adoc @@ -11,6 +11,3 @@ there is no dependency on the AspectJ compiler or weaver. NOTE: Using the AspectJ compiler and weaver enables use of the full AspectJ language and is discussed in xref:core/aop/using-aspectj.adoc[Using AspectJ with Spring Applications]. - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc index 5f4164b845c..4d51624a83c 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/advice.adoc @@ -937,5 +937,3 @@ reflection for javac-compiled classes). Consider collapsing such advice methods advice method per join point in each `@Aspect` class or refactor the pieces of advice into separate `@Aspect` classes that you can order at the aspect level via `Ordered` or `@Order`. ==== - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/at-aspectj.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/at-aspectj.adoc index 4672c2d547b..d526df0e217 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/at-aspectj.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/at-aspectj.adoc @@ -32,6 +32,3 @@ stereotype annotation that qualifies, as per the rules of Spring's component sca NOTE: In Spring AOP, aspects themselves cannot be the targets of advice from other aspects. The `@Aspect` annotation on a class marks it as an aspect and, hence, excludes it from auto-proxying. - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc index 6fd5e242bf3..aca99711d35 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/example.adoc @@ -18,7 +18,8 @@ call `proceed` multiple times. The following listing shows the basic aspect impl include-code::./ConcurrentOperationExecutor[tag=snippet,indent=0] -`@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions]. +`@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in +xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions]. Note that the aspect implements the `Ordered` interface so that we can set the precedence of the aspect higher than the transaction advice (we want a fresh transaction each time we diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/instantiation-models.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/instantiation-models.adoc index b8d5eab1b40..008d735ed83 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/instantiation-models.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/instantiation-models.adoc @@ -60,6 +60,3 @@ Programming Guide for more information on `per` clauses. The `pertarget` instantiation model works in exactly the same way as `perthis`, but it creates one aspect instance for each unique target object at matched join points. - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/introductions.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/introductions.adoc index 3244d288f9f..ecb8589c867 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/introductions.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/introductions.adoc @@ -75,5 +75,3 @@ Kotlin:: val usageTracked = context.getBean("myService") ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/pointcuts.adoc b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/pointcuts.adoc index 35f6b8d1dd2..5dba349f913 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/ataspectj/pointcuts.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/ataspectj/pointcuts.adoc @@ -581,6 +581,3 @@ performance (time and memory used), due to extra processing and analysis. Scopin designators are very fast to match, and using them means AspectJ can very quickly dismiss groups of join points that should not be further processed. A good pointcut should always include one if possible. - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/choosing.adoc b/framework-docs/modules/ROOT/pages/core/aop/choosing.adoc index 910d6c02789..5b437858d6d 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/choosing.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/choosing.adoc @@ -8,7 +8,6 @@ decisions are influenced by a number of factors including application requiremen development tools, and team familiarity with AOP. - [[aop-spring-or-aspectj]] == Spring AOP or Full AspectJ? @@ -31,7 +30,6 @@ the @AspectJ style, sticking with regular Java compilation in your IDE, and addi an aspect weaving phase to your build script. - [[aop-ataspectj-or-xml]] == @AspectJ or XML for Spring AOP? @@ -107,7 +105,3 @@ Spring AOP and by AspectJ. So, if you later decide you need the capabilities of to implement additional requirements, you can easily migrate to a classic AspectJ setup. In general, the Spring team prefers the @AspectJ style for custom aspects beyond simple configuration of enterprise services. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/introduction-defn.adoc b/framework-docs/modules/ROOT/pages/core/aop/introduction-defn.adoc index 2c87464cb60..656fb0fc2a3 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/introduction-defn.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/introduction-defn.adoc @@ -73,7 +73,3 @@ it from older technologies offering only interception. Pointcuts enable advice t targeted independently of the object-oriented hierarchy. For example, you can apply an around advice providing declarative transaction management to a set of methods that span multiple objects (such as all business operations in the service layer). - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/introduction-proxies.adoc b/framework-docs/modules/ROOT/pages/core/aop/introduction-proxies.adoc index d13db919685..59eedb42b16 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/introduction-proxies.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/introduction-proxies.adoc @@ -14,9 +14,5 @@ need to advise a method that is not declared on an interface or where you need t pass a proxied object to a method as a concrete type. It is important to grasp the fact that Spring AOP is proxy-based. See -xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies] for a thorough examination of exactly what this -implementation detail actually means. - - - - +xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies] +for a thorough examination of exactly what this implementation detail actually means. diff --git a/framework-docs/modules/ROOT/pages/core/aop/introduction-spring-defn.adoc b/framework-docs/modules/ROOT/pages/core/aop/introduction-spring-defn.adoc index 84ef5d6e582..a59efbed2d3 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/introduction-spring-defn.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/introduction-spring-defn.adoc @@ -52,10 +52,6 @@ configuration-style approach. The fact that this chapter chooses to introduce th @AspectJ-style approach first should not be taken as an indication that the Spring team favors the @AspectJ annotation-style approach over the Spring XML configuration-style. -See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more complete discussion of the advantages and disadvantages of -each style. +See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more +complete discussion of the advantages and disadvantages of each style. ==== - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/mixing-styles.adoc b/framework-docs/modules/ROOT/pages/core/aop/mixing-styles.adoc index 84bb7c41ada..81e3de6d9e4 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/mixing-styles.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/mixing-styles.adoc @@ -6,7 +6,3 @@ It is perfectly possible to mix @AspectJ style aspects by using the auto-proxyin schema-defined `` aspects, `` declared advisors, and even proxies and interceptors in other styles in the same configuration. All of these are implemented by using the same underlying support mechanism and can co-exist without any difficulty. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/proxying.adoc b/framework-docs/modules/ROOT/pages/core/aop/proxying.adoc index 3150e07c5df..58d150a4c8d 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/proxying.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/proxying.adoc @@ -61,7 +61,6 @@ proxies _for all three of them_. ==== - [[aop-understanding-aop-proxies]] == Understanding AOP Proxies @@ -291,4 +290,3 @@ Kotlin:: NOTE: AspectJ compile-time weaving and load-time weaving do not have this self-invocation issue because they apply advice within the bytecode instead of via a proxy. - diff --git a/framework-docs/modules/ROOT/pages/core/aop/schema.adoc b/framework-docs/modules/ROOT/pages/core/aop/schema.adoc index ed66092d269..c8a7747975e 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/schema.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/schema.adoc @@ -26,7 +26,6 @@ use either only the `` style or only the `AutoProxyCreator` style an never mix them. - [[aop-schema-declaring-an-aspect]] == Declaring an Aspect @@ -54,7 +53,6 @@ The bean that backs the aspect (`aBean` in this case) can of course be configure dependency injected just like any other Spring bean. - [[aop-schema-pointcuts]] == Declaring a Pointcut @@ -177,9 +175,7 @@ follows: Note that pointcuts defined in this way are referred to by their XML `id` and cannot be used as named pointcuts to form composite pointcuts. The named pointcut support in the -schema-based definition style is thus more limited than that offered by the @AspectJ -style. - +schema-based definition style is thus more limited than that offered by the @AspectJ style. [[aop-schema-advice]] @@ -188,7 +184,6 @@ style. The schema-based AOP support uses the same five kinds of advice as the @AspectJ style, and they have exactly the same semantics. - [[aop-schema-advice-before]] === Before Advice @@ -237,7 +232,6 @@ that contains the advice. Before a data access operation is performed (a method join point matched by the pointcut expression), the `doAccessCheck` method on the aspect bean is invoked. - [[aop-schema-advice-after-returning]] === After Returning Advice @@ -295,7 +289,6 @@ Kotlin:: ---- ====== - [[aop-schema-advice-after-throwing]] === After Throwing Advice @@ -353,7 +346,6 @@ Kotlin:: ---- ====== - [[aop-schema-advice-after-finally]] === After (Finally) Advice @@ -372,7 +364,6 @@ You can declare it by using the `after` element, as the following example shows: ---- - [[aop-schema-advice-around]] === Around Advice @@ -444,17 +435,18 @@ Kotlin:: ---- ====== - [[aop-schema-params]] === Advice Parameters The schema-based declaration style supports fully typed advice in the same way as described for the @AspectJ support -- by matching pointcut parameters by name against -advice method parameters. See xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details. If you wish -to explicitly specify argument names for the advice methods (not relying on the +advice method parameters. See +xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details. +If you wish to explicitly specify argument names for the advice methods (not relying on the detection strategies previously described), you can do so by using the `arg-names` attribute of the advice element, which is treated in the same manner as the `argNames` -attribute in an advice annotation (as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]). +attribute in an advice annotation (as described in +xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]). The following example shows how to specify an argument name in XML: [source,xml,indent=0,subs="verbatim"] @@ -464,7 +456,8 @@ The following example shows how to specify an argument name in XML: method="audit" arg-names="auditable" /> ---- -<1> References the `publicMethod` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions]. +<1> References the `publicMethod` named pointcut defined in +xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions]. The `arg-names` attribute accepts a comma-delimited list of parameter names. @@ -645,15 +638,15 @@ ms % Task name 00000 ? execution(getFoo) ---- - [[aop-ordering]] === Advice Ordering When multiple pieces of advice need to run at the same join point (executing method) -the ordering rules are as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The precedence -between aspects is determined via the `order` attribute in the `` element or -by either adding the `@Order` annotation to the bean that backs the aspect or by having -the bean implement the `Ordered` interface. +the ordering rules are as described in +xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The +precedence between aspects is determined via the `order` attribute in the `` +element or by either adding the `@Order` annotation to the bean that backs the aspect +or by having the bean implement the `Ordered` interface. [NOTE] ==== @@ -676,7 +669,6 @@ at the aspect level. ==== - [[aop-schema-introductions]] == Introductions @@ -756,7 +748,6 @@ Kotlin:: ====== - [[aop-schema-instantiation-models]] == Aspect Instantiation Models @@ -764,7 +755,6 @@ The only supported instantiation model for schema-defined aspects is the singlet model. Other instantiation models may be supported in future releases. - [[aop-schema-advisors]] == Advisors @@ -772,7 +762,8 @@ The concept of "advisors" comes from the AOP support defined in Spring and does not have a direct equivalent in AspectJ. An advisor is like a small self-contained aspect that has a single piece of advice. The advice itself is represented by a bean and must implement one of the advice interfaces described in -xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring]. Advisors can take advantage of AspectJ pointcut expressions. +xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring]. +Advisors can take advantage of AspectJ pointcut expressions. Spring supports the advisor concept with the `` element. You most commonly see it used in conjunction with transactional advice, which also has its own @@ -805,7 +796,6 @@ To define the precedence of an advisor so that the advice can participate in ord use the `order` attribute to define the `Ordered` value of the advisor. - [[aop-schema-example]] == An AOP Schema Example @@ -981,7 +971,3 @@ pointcut expression so that only `@Idempotent` operations match, as follows: expression="execution(* com.xyz.service.*.*(..)) and @annotation(com.xyz.service.Idempotent)"/> ---- - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc b/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc index 548d27257fb..b03a392596f 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc @@ -8,12 +8,14 @@ alone. Spring ships with a small AspectJ aspect library, which is available stand-alone in your distribution as `spring-aspects.jar`. You need to add this to your classpath in order -to use the aspects in it. xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring] and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ] discuss the -content of this library and how you can use it. xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC] discusses how to -dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally, -xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework] provides an introduction to load-time weaving for Spring applications -that use AspectJ. - +to use the aspects in it. +xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring] +and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ] +discuss the content of this library and how you can use it. +xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC] +discusses how to dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally, +xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework] +provides an introduction to load-time weaving for Spring applications that use AspectJ. [[aop-atconfigurable]] @@ -206,7 +208,6 @@ not use `@Configurable` on bean classes that are registered as regular Spring be with the container. Doing so results in double initialization, once through the container and once through the aspect. - [[aop-configurable-testing]] === Unit Testing `@Configurable` Objects @@ -219,7 +220,6 @@ you can still unit test outside of the container as normal, but you see a warnin message each time that you construct a `@Configurable` object indicating that it has not been configured by Spring. - [[aop-configurable-container]] === Working with Multiple Application Contexts @@ -249,7 +249,6 @@ is added only to the container-wide classpath (and hence loaded by the shared pa not what you want). - [[aop-ajlib-other]] == Other Spring aspects for AspectJ @@ -302,7 +301,6 @@ fully qualified class names: ---- - [[aop-aj-configure]] == Configuring AspectJ Aspects by Using Spring IoC @@ -357,7 +355,6 @@ results in the creation of Spring AOP proxies. The @AspectJ style of aspect declaration is being used here, but the AspectJ runtime is not involved. - [[aop-aj-ltw]] == Load-time Weaving with AspectJ in the Spring Framework @@ -391,7 +388,6 @@ LTW that uses Spring, followed by detailed specifics about elements introduced i example. For a complete example, see the {petclinic-github-org}/spring-framework-petclinic[Petclinic sample application based on Spring Framework]. - [[aop-aj-ltw-first-example]] === A First Example @@ -677,7 +673,6 @@ nice example of a development-time aspect that developers can use during develop and then easily exclude from builds of the application being deployed into UAT or production. - [[aop-aj-ltw-the-aspects]] === Aspects @@ -686,7 +681,6 @@ either the AspectJ language itself, or you can write your aspects in the @Aspect Your aspects are then both valid AspectJ and Spring AOP aspects. Furthermore, the compiled aspect classes need to be available on the classpath. - [[aop-aj-ltw-aop_dot_xml]] === `META-INF/aop.xml` @@ -716,7 +710,6 @@ The structure and contents of this file is detailed in the LTW part of the {aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference documentation]. Because the `aop.xml` file is 100% AspectJ, we do not describe it further here. - [[aop-aj-ltw-libraries]] === Required libraries (JARS) @@ -731,7 +724,6 @@ If you use the xref:core/aop/using-aspectj.adoc#aop-aj-ltw-environments-generic[ * `spring-instrument.jar` - [[aop-aj-ltw-spring]] === Spring Configuration @@ -831,7 +823,6 @@ possible values: then AspectJ weaving is on. Otherwise, it is off. This is the default value. |=== - [[aop-aj-ltw-environments]] === Environment-specific Configuration @@ -880,7 +871,3 @@ Note that this requires modification of the JVM launch script, which may prevent from using this in application server environments (depending on your server and your operation policies). That said, for one-app-per-JVM deployments such as standalone Spring Boot applications, you typically control the entire JVM setup in any case. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/aot.adoc b/framework-docs/modules/ROOT/pages/core/aot.adoc index d949caf9ac4..8a3f9113e17 100644 --- a/framework-docs/modules/ROOT/pages/core/aot.adoc +++ b/framework-docs/modules/ROOT/pages/core/aot.adoc @@ -5,6 +5,7 @@ This chapter covers Spring's Ahead of Time (AOT) optimizations. For AOT support specific to integration tests, see xref:testing/testcontext-framework/aot.adoc[Ahead of Time Support for Tests]. + [[aot.introduction]] == Introduction to Ahead of Time Optimizations @@ -35,6 +36,7 @@ A Spring AOT processed application typically generates: NOTE: At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM. We intend to support more JVM-based use cases in future generations. + [[aot.basics]] == AOT Engine Overview @@ -51,6 +53,7 @@ The `RuntimeHints` instance can also be used to generate the relevant GraalVM na Those steps are covered in greater detail in the sections below. + [[aot.refresh]] == Refresh for AOT Processing @@ -88,6 +91,7 @@ This makes sure to create any proxy that will be required at runtime. Once this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiation but allows the AOT engine to inspect the beans that will be created at runtime. + [[aot.bean-factory-initialization-contributions]] == Bean Factory Initialization AOT Contributions @@ -110,7 +114,6 @@ We generally recommend that this interface is only implemented by infrastructure If such a bean is registered using an `@Bean` factory method, ensure the method is `static` so that its enclosing `@Configuration` class does not have to be initialized. ==== - [[aot.bean-registration-contributions]] === Bean Registration AOT Contributions @@ -224,6 +227,7 @@ There is a bean definition for `dataSourceConfiguration` and one for `dataSource When a `datasource` instance is required, a `BeanInstanceSupplier` is called. This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean. + [[aot.running]] == Running with AOT Optimizations @@ -235,6 +239,7 @@ NOTE: When AOT optimizations are included, some decisions that have been made at are hard coded in the application setup. For instance, profiles that have been enabled at build time are automatically enabled at runtime as well. + [[aot.bestpractices]] == Best Practices @@ -564,6 +569,7 @@ Kotlin:: ---- ====== + [[aot.hints]] == Runtime Hints @@ -598,7 +604,6 @@ For instance, the return type of a `@Controller` method is inspected, and releva For cases that the core container cannot infer, you can register such hints programmatically. A number of convenient annotations are also provided for common use cases. - [[aot.hints.import-runtime-hints]] === `@ImportRuntimeHints` @@ -616,7 +621,6 @@ This way, if the component is not contributed to the `BeanFactory`, the hints wi It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully-qualified name of the `RuntimeHintsRegistrar` interface. - [[aot.hints.reflective]] === `@Reflective` @@ -639,7 +643,6 @@ This can be tuned by specifying a custom `ReflectiveProcessor` implementation vi Library authors can reuse this annotation for their own purposes. An example of such customization is covered in the next section. - [[aot.hints.register-reflection]] === `@RegisterReflection` diff --git a/framework-docs/modules/ROOT/pages/core/appendix.adoc b/framework-docs/modules/ROOT/pages/core/appendix.adoc index 5cae57dc7d0..404036a7acc 100644 --- a/framework-docs/modules/ROOT/pages/core/appendix.adoc +++ b/framework-docs/modules/ROOT/pages/core/appendix.adoc @@ -1,7 +1,3 @@ [[appendix]] = Appendix :page-section-summary-toc: 1 - - - - diff --git a/framework-docs/modules/ROOT/pages/core/appendix/xml-custom.adoc b/framework-docs/modules/ROOT/pages/core/appendix/xml-custom.adoc index c029f5dd7e0..ca2fd246eda 100644 --- a/framework-docs/modules/ROOT/pages/core/appendix/xml-custom.adoc +++ b/framework-docs/modules/ROOT/pages/core/appendix/xml-custom.adoc @@ -12,7 +12,6 @@ Spring's extensible XML configuration mechanism is based on XML Schema. If you a familiar with Spring's current XML configuration extensions that come with the standard Spring distribution, you should first read the previous section on xref:core/appendix/xsd-schemas.adoc[XML Schemas]. - To create new XML configuration extensions: . xref:core/appendix/xml-custom.adoc#core.appendix.xsd-custom-schema[Author] an XML schema to describe your custom element(s). @@ -38,7 +37,6 @@ examples follow later in this appendix. The intent of this first simple example through the basic steps of making a custom extension.) - [[xsd-custom-schema]] == Authoring the Schema @@ -110,7 +108,6 @@ can use autocompletion to let a user choose between several configuration option defined in the enumeration. - [[xsd-custom-namespacehandler]] == Coding a `NamespaceHandler` @@ -187,7 +184,6 @@ means that each `BeanDefinitionParser` contains only the logic for parsing a sin custom element, as we can see in the next step. - [[xsd-custom-parser]] == Using `BeanDefinitionParser` @@ -276,13 +272,11 @@ the basic grunt work of creating a single `BeanDefinition`. single `BeanDefinition` represents. ====== - In this simple case, this is all that we need to do. The creation of our single `BeanDefinition` is handled by the `AbstractSingleBeanDefinitionParser` superclass, as is the extraction and setting of the bean definition's unique identifier. - [[xsd-custom-registration]] == Registering the Handler and the Schema @@ -294,7 +288,6 @@ can, for example, be distributed alongside your binary classes in a JAR file. Th XML parsing infrastructure automatically picks up your new extension by consuming these special properties files, the formats of which are detailed in the next two sections. - [[xsd-custom-registration-spring-handlers]] === Writing `META-INF/spring.handlers` @@ -313,7 +306,6 @@ The first part (the key) of the key-value pair is the URI associated with your c namespace extension and needs to exactly match exactly the value of the `targetNamespace` attribute, as specified in your custom XSD schema. - [[xsd-custom-registration-spring-schemas]] === Writing 'META-INF/spring.schemas' @@ -337,7 +329,6 @@ You are encouraged to deploy your XSD file (or files) right alongside the `NamespaceHandler` and `BeanDefinitionParser` classes on the classpath. - [[xsd-custom-using]] == Using a Custom Extension in Your Spring XML Configuration @@ -371,13 +362,11 @@ in a Spring XML configuration file: <1> Our custom bean. - [[xsd-custom-meat]] == More Detailed Examples This section presents some more detailed examples of custom XML extensions. - [[xsd-custom-custom-nested]] === Nesting Custom Elements within Custom Elements @@ -753,7 +742,6 @@ http\://www.foo.example/schema/component=com.foo.ComponentNamespaceHandler http\://www.foo.example/schema/component/component.xsd=com/foo/component.xsd ---- - [[xsd-custom-custom-just-attributes]] === Custom Attributes on "`Normal`" Elements @@ -1007,5 +995,3 @@ http\://www.foo.example/schema/jcache=com.foo.JCacheNamespaceHandler # in 'META-INF/spring.schemas' http\://www.foo.example/schema/jcache/jcache.xsd=com/foo/jcache.xsd ---- - - diff --git a/framework-docs/modules/ROOT/pages/core/appendix/xsd-schemas.adoc b/framework-docs/modules/ROOT/pages/core/appendix/xsd-schemas.adoc index 55b3141dda0..c6532deebb7 100644 --- a/framework-docs/modules/ROOT/pages/core/appendix/xsd-schemas.adoc +++ b/framework-docs/modules/ROOT/pages/core/appendix/xsd-schemas.adoc @@ -4,7 +4,6 @@ This part of the appendix lists XML schemas related to the core container. - [[xsd-schemas-util]] == The `util` Schema @@ -29,7 +28,6 @@ correct schema so that the tags in the `util` namespace are available to you): ---- - [[xsd-schemas-util-constant]] === Using `` @@ -186,7 +184,6 @@ Kotlin:: ---- - [[xsd-schemas-util-property-path]] === Using `` @@ -308,7 +305,6 @@ You can specifically set the result type in the actual definition. This is not n for most use cases, but it can sometimes be useful. See the javadoc for more info on this feature. - [[xsd-schemas-util-properties]] === Using `` @@ -334,7 +330,6 @@ The following example uses a `util:properties` element to make a more concise re ---- - [[xsd-schemas-util-list]] === Using `` @@ -389,7 +384,6 @@ following configuration: If no `list-class` attribute is supplied, the container chooses a `List` implementation. - [[xsd-schemas-util-map]] === Using `` @@ -444,7 +438,6 @@ following configuration: If no `'map-class'` attribute is supplied, the container chooses a `Map` implementation. - [[xsd-schemas-util-set]] === Using `` @@ -500,7 +493,6 @@ following configuration: If no `set-class` attribute is supplied, the container chooses a `Set` implementation. - [[xsd-schemas-aop]] == The `aop` Schema @@ -530,7 +522,6 @@ are available to you): ---- - [[xsd-schemas-context]] == The `context` Schema @@ -555,7 +546,6 @@ available to you: ---- - [[xsd-schemas-context-pphc]] === Using `` @@ -599,34 +589,25 @@ element for that purpose. Similarly, Spring's xref:integration/cache/annotations.adoc[caching annotations] need to be explicitly xref:integration/cache/annotations.adoc#cache-annotation-enable[enabled] as well. - [[xsd-schemas-context-component-scan]] === Using `` -This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration] -. - +This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration]. [[xsd-schemas-context-ltw]] === Using `` -This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework] -. - +This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework]. [[xsd-schemas-context-sc]] === Using `` -This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring] -. - +This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring]. [[xsd-schemas-context-mbe]] === Using `` -This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export] -. - +This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export]. [[xsd-schemas-beans]] @@ -666,7 +647,3 @@ as it stands). In the case of the preceding example, you could assume that there is some logic that consumes the bean definition and sets up some caching infrastructure that uses the supplied metadata. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans.adoc b/framework-docs/modules/ROOT/pages/core/beans.adoc index 7def6a8c23a..edd63ce205c 100644 --- a/framework-docs/modules/ROOT/pages/core/beans.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans.adoc @@ -3,7 +3,3 @@ :page-section-summary-toc: 1 This chapter covers Spring's Inversion of Control (IoC) container. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config.adoc index 33e48c41a23..2ae12e0360c 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config.adoc @@ -62,6 +62,3 @@ application context in which it is defined. This means that, if you put it only checks for `@Autowired` beans in your controllers, and not your services. See xref:web/webmvc/mvc-servlet.adoc[The DispatcherServlet] for more information. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-primary.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-primary.adoc index af63a56aa66..476c98ba71b 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-primary.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-primary.adoc @@ -152,6 +152,3 @@ The corresponding bean definitions follow: ---- - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-qualifiers.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-qualifiers.adoc index 07073d26928..1758ca42d76 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-qualifiers.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired-qualifiers.adoc @@ -568,6 +568,3 @@ the following example: ---- -- - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired.adoc index 015e73b748f..c108047ec6c 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/autowired.adoc @@ -530,6 +530,3 @@ The `@Autowired`, `@Inject`, `@Value`, and `@Resource` annotations are handled b within your own `BeanPostProcessor` or `BeanFactoryPostProcessor` types (if any). These types must be 'wired up' explicitly by using XML or a Spring `@Bean` method. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/custom-autowire-configurer.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/custom-autowire-configurer.adoc index 0ca89cd0ab4..2c7fc82da4c 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/custom-autowire-configurer.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/custom-autowire-configurer.adoc @@ -28,6 +28,3 @@ with the `CustomAutowireConfigurer` When multiple beans qualify as autowire candidates, the determination of a "`primary`" is as follows: If exactly one bean definition among the candidates has a `primary` attribute set to `true`, it is selected. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/generics-as-qualifiers.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/generics-as-qualifiers.adoc index 2182e114d79..2fdf6c6d9ee 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/generics-as-qualifiers.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/generics-as-qualifiers.adoc @@ -96,6 +96,3 @@ Kotlin:: private lateinit var s: List> ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/postconstruct-and-predestroy-annotations.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/postconstruct-and-predestroy-annotations.adoc index 12afd6d4aff..75cad92f208 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/postconstruct-and-predestroy-annotations.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/postconstruct-and-predestroy-annotations.adoc @@ -64,7 +64,3 @@ JDK 11. As of Jakarta EE 9, the package lives in `jakarta.annotation` now. If ne the `jakarta.annotation-api` artifact needs to be obtained via Maven Central now, simply to be added to the application's classpath like any other library. ==== - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/resource.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/resource.adoc index 0c24fd143ae..12d15bedef1 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/resource.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/resource.adoc @@ -142,4 +142,3 @@ Kotlin:: `ApplicationContext`. ====== -- - diff --git a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/value-annotations.adoc b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/value-annotations.adoc index d91aaafb19b..f5c85c8d8ea 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/annotation-config/value-annotations.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/annotation-config/value-annotations.adoc @@ -241,5 +241,3 @@ Kotlin:: @Value("#{{'Thriller': 100, 'Comedy': 300}}") private val countOfMoviesPerCatalog: Map) ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/basics.adoc b/framework-docs/modules/ROOT/pages/core/beans/basics.adoc index 4d209d1b728..7dfb88f72c1 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/basics.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/basics.adoc @@ -29,7 +29,6 @@ created and initialized, you have a fully configured and executable system or ap image::container-magic.png[] - [[beans-factory-metadata]] == Configuration Metadata @@ -63,8 +62,6 @@ Typically, one does not configure fine-grained domain objects in the container, it is usually the responsibility of repositories and business logic to create and load domain objects. - - [[beans-factory-xml]] === XML as an External Configuration DSL @@ -188,7 +185,6 @@ definition. This linkage between `id` and `ref` elements expresses the dependenc collaborating objects. For details of configuring an object's dependencies, see xref:core/beans/dependencies.adoc[Dependencies]. - [[beans-factory-xml-import]] === Composing XML-based Configuration Metadata @@ -244,7 +240,6 @@ The namespace itself provides the import directive feature. Further configuration features beyond plain bean definitions are available in a selection of XML namespaces provided by Spring -- for example, the `context` and `util` namespaces. - [[beans-factory-groovy]] === The Groovy Bean Definition DSL @@ -279,7 +274,6 @@ supports Spring's XML configuration namespaces. It also allows for importing XML bean definition files through an `importBeans` directive. - [[beans-factory-client]] == Using the Container @@ -403,6 +397,3 @@ code should never use them. Indeed, your application code should have no calls t Spring's integration with web frameworks provides dependency injection for various web framework components such as controllers and JSF-managed beans, letting you declare a dependency on a specific bean through metadata (such as an autowiring annotation). - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/beanfactory.adoc b/framework-docs/modules/ROOT/pages/core/beans/beanfactory.adoc index 42d873fb82d..20d280d8ba1 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/beanfactory.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/beanfactory.adoc @@ -21,7 +21,6 @@ operate on shared `BeanDefinition` objects as a core metadata representation. This is the essence of what makes Spring's container so flexible and extensible. - [[context-introduction-ctx-vs-beanfactory]] == `BeanFactory` or `ApplicationContext`? diff --git a/framework-docs/modules/ROOT/pages/core/beans/child-bean-definitions.adoc b/framework-docs/modules/ROOT/pages/core/beans/child-bean-definitions.adoc index 2c4d287a08f..36d389d9090 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/child-bean-definitions.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/child-bean-definitions.adoc @@ -78,7 +78,3 @@ important (at least for singleton beans) that if you have a (parent) bean defini which you intend to use only as a template, and this definition specifies a class, you must make sure to set the __abstract__ attribute to __true__, otherwise the application context will actually (attempt to) pre-instantiate the `abstract` bean. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/classpath-scanning.adoc b/framework-docs/modules/ROOT/pages/core/beans/classpath-scanning.adoc index 8193305116b..25a6570b132 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/classpath-scanning.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/classpath-scanning.adoc @@ -22,7 +22,6 @@ use these features. ==== - [[beans-stereotype-annotations]] == `@Component` and Further Stereotype Annotations @@ -46,7 +45,6 @@ clearly the better choice. Similarly, as stated earlier, `@Repository` is alread supported as a marker for automatic exception translation in your persistence layer. - [[beans-meta-annotations]] == Using Meta-annotations and Composed Annotations @@ -195,7 +193,6 @@ For further details, see the wiki page. - [[beans-scanning-autodetection]] == Automatically Detecting Classes and Registering Bean Definitions @@ -334,7 +331,6 @@ NOTE: You can disable the registration of `AutowiredAnnotationBeanPostProcessor` with a value of `false`. - [[beans-scanning-filters]] == Using Filters to Customize Scanning @@ -426,7 +422,6 @@ annotated or meta-annotated with `@Component`, `@Repository`, `@Service`, `@Cont `@RestController`, or `@Configuration`. - [[beans-factorybeans-annotations]] == Defining Bean Metadata within Components @@ -663,7 +658,6 @@ analogous to how the container selects between multiple `@Autowired` constructor ==== - [[beans-scanning-name-generator]] == Naming Autodetected Components @@ -797,7 +791,6 @@ components may be making explicit references to it. On the other hand, the auto-generated names are adequate whenever the container is responsible for wiring. - [[beans-scanning-scope-resolver]] == Providing a Scope for Autodetected Components @@ -920,7 +913,6 @@ Kotlin:: ---- - [[beans-scanning-qualifiers]] == Providing Qualifier Metadata with Annotations @@ -1012,7 +1004,3 @@ NOTE: As with most annotation-based alternatives, keep in mind that the annotati bound to the class definition itself, while the use of XML allows for multiple beans of the same type to provide variations in their qualifier metadata, because that metadata is provided per-instance rather than per-class. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc index 537b90cc5f8..7f6f19572af 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/context-introduction.adoc @@ -24,7 +24,6 @@ package also provides the following functionality: `HierarchicalBeanFactory` interface. - [[context-functionality-messagesource]] == Internationalization using `MessageSource` @@ -273,7 +272,6 @@ See the {spring-framework-api}/context/support/ReloadableResourceBundleMessageSo javadoc for details. - [[context-functionality-events]] == Standard and Custom Events @@ -534,7 +532,6 @@ complete support for building lightweight, https://www.enterpriseintegrationpatterns.com[pattern-oriented], event-driven architectures that build upon the well-known Spring programming model. - [[context-functionality-events-annotation]] === Annotation-based Event Listeners @@ -707,7 +704,6 @@ The `handleBlockedListEvent()` method publishes a new `ListUpdateEvent` for ever `BlockedListEvent` that it handles. If you need to publish several events, you can return a `Collection` or an array of events instead. - [[context-functionality-events-async]] === Asynchronous Listeners @@ -754,7 +750,6 @@ Be aware of the following limitations when using asynchronous events: See xref:integration/observability.adoc#observability.application-events[the `@EventListener` Observability section] for more information on Observability concerns. - [[context-functionality-events-order]] === Ordering Listeners @@ -786,7 +781,6 @@ Kotlin:: ---- ====== - [[context-functionality-events-generics]] === Generic Events @@ -880,7 +874,6 @@ for example, for processing all events asynchronously and/or for handling listen ---- - [[context-functionality-resources]] == Convenient Access to Low-level Resources @@ -913,7 +906,6 @@ with special prefixes to force loading of definitions from the classpath or a UR regardless of the actual context type. - [[context-functionality-startup]] == Application Startup Tracking @@ -990,6 +982,7 @@ or ask for the `ApplicationStartup` type on any injection point. NOTE: Developers should not use the `"spring.*"` namespace when creating custom startup steps. This namespace is reserved for internal Spring usage and is subject to change. + [[context-create]] == Convenient ApplicationContext Instantiation for Web Applications @@ -1022,7 +1015,6 @@ Examples are `/WEB-INF/{asterisk}Context.xml` (for all files with names that end (for all such files in any subdirectory of `WEB-INF`). - [[context-deploy-rar]] == Deploying a Spring `ApplicationContext` as a Jakarta EE RAR File @@ -1053,7 +1045,8 @@ all application classes into a RAR file (which is a standard JAR file with a dif file extension). . Add all required library JARs into the root of the RAR archive. . Add a -`META-INF/ra.xml` deployment descriptor (as shown in the {spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`]) +`META-INF/ra.xml` deployment descriptor (as shown in the +{spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`]) and the corresponding Spring XML bean definition file(s) (typically `META-INF/applicationContext.xml`). . Drop the resulting RAR file into your @@ -1066,7 +1059,3 @@ other modules. A RAR-based `ApplicationContext` may also, for example, schedule or react to new files in the file system (or the like). If it needs to allow synchronous access from the outside, it could (for example) export RMI endpoints, which may be used by other application modules on the same machine. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/context-load-time-weaver.adoc b/framework-docs/modules/ROOT/pages/core/beans/context-load-time-weaver.adoc index 3857be9891e..ea25df7e9ea 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/context-load-time-weaver.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/context-load-time-weaver.adoc @@ -45,8 +45,5 @@ xref:data-access/orm/jpa.adoc[Spring's JPA support] where load-time weaving may necessary for JPA class transformation. Consult the {spring-framework-api}/orm/jpa/LocalContainerEntityManagerFactoryBean.html[`LocalContainerEntityManagerFactoryBean`] -javadoc for more detail. For more on AspectJ load-time weaving, see xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]. - - - - +javadoc for more detail. For more on AspectJ load-time weaving, see +xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]. diff --git a/framework-docs/modules/ROOT/pages/core/beans/definition.adoc b/framework-docs/modules/ROOT/pages/core/beans/definition.adoc index 4be43e5371c..ed7df447d09 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/definition.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/definition.adoc @@ -74,7 +74,6 @@ lead to concurrent access exceptions, inconsistent state in the bean container, ==== - [[beans-definition-overriding]] == Overriding Beans @@ -104,7 +103,6 @@ explicit support for this as of Spring Framework 6.2. Please refer to xref:testing/testcontext-framework/bean-overriding.adoc[this section] for more details. - [[beans-beanname]] == Naming Beans @@ -147,7 +145,6 @@ case when there is more than one character and both the first and second charact are upper case, the original casing gets preserved. These are the same rules as defined by `java.beans.Introspector.decapitalize` (which Spring uses here). - [[beans-beanname-alias]] === Aliasing a Bean outside the Bean Definition @@ -197,7 +194,6 @@ See xref:core/beans/java/bean-annotation.adoc[Using the `@Bean` Annotation] for **** - [[beans-factory-class]] == Instantiating Beans @@ -209,7 +205,8 @@ If you use XML-based configuration metadata, you specify the type (or class) of that is to be instantiated in the `class` attribute of the `` element. This `class` attribute (which, internally, is a `Class` property on a `BeanDefinition` instance) is usually mandatory. (For exceptions, see -xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method] and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].) +xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method] +and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].) You can use the `Class` property in one of two ways: * Typically, to specify the bean class to be constructed in the case where the container @@ -233,7 +230,6 @@ a bean definition would be `com.example.SomeThing$OtherThing` or `com.example.SomeThing.OtherThing`. **** - [[beans-factory-class-ctor]] === Instantiation with a Constructor @@ -268,7 +264,6 @@ NOTE: In the case of constructor arguments, the container can select a correspon constructor among several overloaded constructors. That said, to avoid ambiguities, it is recommended to keep your constructor signatures as straightforward as possible. - [[beans-factory-class-static-factory-method]] === Instantiation with a Static Factory Method @@ -346,7 +341,6 @@ overloads of the `mock` method. Choose the most specific variant of `mock` possi ---- ==== - [[beans-factory-class-instance-factory-method]] === Instantiation by Using an Instance Factory Method @@ -478,7 +472,6 @@ xref:core/beans/definition.adoc#beans-factory-class-static-factory-method[static `FactoryBean` (notice the capitalization) refers to a Spring-specific xref:core/beans/factory-extension.adoc#beans-factory-extension-factorybean[`FactoryBean`] implementation class. - [[beans-factory-type-determination]] === Determining a Bean's Runtime Type @@ -494,5 +487,3 @@ The recommended way to find out about the actual runtime type of a particular be a `BeanFactory.getType` call for the specified bean name. This takes all of the above cases into account and returns the type of object that a `BeanFactory.getBean` call is going to return for the same bean name. - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/dependencies.adoc b/framework-docs/modules/ROOT/pages/core/beans/dependencies.adoc index e22058a1ff3..e8dd916197f 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/dependencies.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/dependencies.adoc @@ -7,6 +7,3 @@ Spring parlance). Even the simplest application has a few objects that work toge present what the end-user sees as a coherent application. This next section explains how you go from defining a number of bean definitions that stand alone to a fully realized application where objects collaborate to achieve a goal. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-autowire.adoc b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-autowire.adoc index fa7ba3de484..99831396b6e 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-autowire.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-autowire.adoc @@ -16,7 +16,8 @@ advantages: during development, without negating the option of switching to explicit wiring when the code base becomes more stable. -When using XML-based configuration metadata (see xref:core/beans/dependencies/factory-collaborators.adoc[Dependency Injection]), you +When using XML-based configuration metadata (see +xref:core/beans/dependencies/factory-collaborators.adoc[Dependency Injection]), you can specify the autowire mode for a bean definition with the `autowire` attribute of the `` element. The autowiring functionality has four modes. You specify autowiring per bean and can thus choose which ones to autowire. The following table describes the @@ -60,7 +61,6 @@ instance's values consist of all bean instances that match the expected type, an `Map` instance's keys contain the corresponding bean names. - [[beans-autowired-exceptions]] == Limitations and Disadvantages of Autowiring @@ -90,14 +90,14 @@ In the latter scenario, you have several options: * Abandon autowiring in favor of explicit wiring. * Avoid autowiring for a bean definition by setting its `autowire-candidate` attributes - to `false`, as described in the xref:core/beans/dependencies/factory-autowire.adoc#beans-factory-autowire-candidate[next section]. + to `false`, as described in the + xref:core/beans/dependencies/factory-autowire.adoc#beans-factory-autowire-candidate[next section]. * Designate a single bean definition as the primary candidate by setting the `primary` attribute of its `` element to `true`. * Implement the more fine-grained control available with annotation-based configuration, as described in xref:core/beans/annotation-config.adoc[Annotation-based Container Configuration]. - [[beans-factory-autowire-candidate]] == Excluding a Bean from Autowiring @@ -139,6 +139,3 @@ get injected by plain declared type only, rather by type plus specific qualifier In contrast, `autowireCandidate=false` behaves exactly like the `autowire-candidate` attribute as explained above: Such a bean will never get injected by type at all. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-collaborators.adoc b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-collaborators.adoc index 2559135e4d9..405123d5018 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-collaborators.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-collaborators.adoc @@ -16,8 +16,9 @@ not know the location or class of the dependencies. As a result, your classes be to test, particularly when the dependencies are on interfaces or abstract base classes, which allow for stub or mock implementations to be used in unit tests. -DI exists in two major variants: xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based dependency injection] - and xref:core/beans/dependencies/factory-collaborators.adoc#beans-setter-injection[Setter-based dependency injection]. +DI exists in two major variants: +xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based dependency injection] +and xref:core/beans/dependencies/factory-collaborators.adoc#beans-setter-injection[Setter-based dependency injection]. [[beans-constructor-injection]] @@ -606,6 +607,3 @@ contains the `static` factory method (although, in this example, it is). An inst (non-static) factory method can be used in an essentially identical fashion (aside from the use of the `factory-bean` attribute instead of the `class` attribute), so we do not discuss those details here. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-dependson.adoc b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-dependson.adoc index fdf50af5067..95e2be3b662 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-dependson.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-dependson.adoc @@ -37,6 +37,3 @@ in the case of xref:core/beans/factory-scopes.adoc#beans-factory-scopes-singleto beans only, a corresponding destruction-time dependency. Dependent beans that define a `depends-on` relationship with a given bean are destroyed first, prior to the given bean itself being destroyed. Thus, `depends-on` can also control shutdown order. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-lazy-init.adoc b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-lazy-init.adoc index 353cf0ae6e1..0cc76124915 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-lazy-init.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/dependencies/factory-lazy-init.adoc @@ -29,6 +29,3 @@ annotated class or in XML using the `default-lazy-init` attribute on the `` and `` elements for this -purpose. +As mentioned in the xref:core/beans/dependencies/factory-collaborators.adoc[previous section], +you can define bean properties and constructor arguments as references to other managed beans +(collaborators) or as values defined inline. Spring's XML-based configuration metadata supports +sub-element types within its `` and `` elements for this purpose. [[beans-value-element]] @@ -544,9 +543,10 @@ three approaches at the same time. [[beans-c-namespace]] == XML Shortcut with the c-namespace -Similar to the xref:core/beans/dependencies/factory-properties-detailed.adoc#beans-p-namespace[XML Shortcut with the p-namespace], the c-namespace, introduced in Spring -3.1, allows inlined attributes for configuring the constructor arguments rather -then nested `constructor-arg` elements. +Similar to the +xref:core/beans/dependencies/factory-properties-detailed.adoc#beans-p-namespace[XML Shortcut with the p-namespace], +the c-namespace, introduced in Spring 3.1, allows inlined attributes for configuring +the constructor arguments rather then nested `constructor-arg` elements. The following example uses the `c:` namespace to do the same thing as the from xref:core/beans/dependencies/factory-collaborators.adoc#beans-constructor-injection[Constructor-based Dependency Injection]: @@ -598,9 +598,9 @@ A corresponding index notation is also available for `` element not commonly used since the plain order of declaration is usually sufficient there. In practice, the constructor resolution -xref:core/beans/dependencies/factory-collaborators.adoc#beans-factory-ctor-arguments-resolution[mechanism] is quite efficient in matching -arguments, so unless you really need to, we recommend using the name notation -throughout your configuration. +xref:core/beans/dependencies/factory-collaborators.adoc#beans-factory-ctor-arguments-resolution[mechanism] +is quite efficient in matching arguments, so unless you really need to, we recommend +using the name notation throughout your configuration. [[beans-compound-property-names]] @@ -621,6 +621,3 @@ The `something` bean has a `fred` property, which has a `bob` property, which ha property, and that final `sammy` property is being set to a value of `123`. In order for this to work, the `fred` property of `something` and the `bob` property of `fred` must not be `null` after the bean is constructed. Otherwise, a `NullPointerException` is thrown. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/environment.adoc b/framework-docs/modules/ROOT/pages/core/beans/environment.adoc index 3b1c8898bed..883fcaeff87 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/environment.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/environment.adoc @@ -20,7 +20,6 @@ user with a convenient service interface for configuring property sources and re properties from them. - [[beans-definition-profiles]] == Bean Definition Profiles @@ -114,7 +113,6 @@ certain contexts but not in others. You could say that you want to register a certain profile of bean definitions in situation A and a different profile in situation B. We start by updating our configuration to reflect this need. - [[beans-definition-profiles-java]] === Using `@Profile` @@ -345,7 +343,6 @@ way to represent such an arrangement in a valid Java class in the first place (since there can only be one method of a particular name and argument signature). ==== - [[beans-definition-profiles-xml]] === XML Bean Definition Profiles @@ -437,7 +434,6 @@ In the preceding example, the `dataSource` bean is exposed if both the `producti `us-east` profiles are active. ===== - [[beans-definition-profiles-enable]] === Activating a Profile @@ -512,7 +508,6 @@ as the following example shows: -Dspring.profiles.active="profile1,profile2" ---- - [[beans-definition-profiles-default]] === Default Profile @@ -567,7 +562,6 @@ the default profile by using `setDefaultProfiles()` on the `Environment` or, declaratively, by using the `spring.profiles.default` property. - [[beans-property-source-abstraction]] == `PropertySource` Abstraction @@ -668,7 +662,6 @@ API exposes a number of methods that allow for precise manipulation of the set o property sources. - [[beans-using-propertysource]] == Using `@PropertySource` @@ -777,7 +770,6 @@ may also be used as a meta-annotation to create custom composed annotations with attribute overrides. - [[beans-placeholder-resolution-in-statements]] == Placeholder Resolution in Statements @@ -798,7 +790,3 @@ property is defined, as long as it is available in the `Environment`: ---- - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/factory-extension.adoc b/framework-docs/modules/ROOT/pages/core/beans/factory-extension.adoc index 56641fd847e..ea79cbfb22f 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/factory-extension.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/factory-extension.adoc @@ -7,7 +7,6 @@ implementations of special integration interfaces. The next few sections describ integration interfaces. - [[beans-factory-extension-bpp]] == Customizing Beans by Using a `BeanPostProcessor` @@ -109,7 +108,6 @@ Spring accesses other beans for matching them by type. The following examples show how to write, register, and use `BeanPostProcessor` instances in an `ApplicationContext`. - [[beans-factory-extension-bpp-examples-hw]] === Example: Hello World, `BeanPostProcessor`-style @@ -244,7 +242,6 @@ Bean 'messenger' created : org.springframework.scripting.groovy.GroovyMessenger@ org.springframework.scripting.groovy.GroovyMessenger@272961 ---- - [[beans-factory-extension-bpp-examples-aabpp]] === Example: The `AutowiredAnnotationBeanPostProcessor` @@ -255,7 +252,6 @@ that ships with the Spring distribution and autowires annotated fields, setter m and arbitrary config methods. - [[beans-factory-extension-factory-postprocessors]] == Customizing Configuration Metadata with a `BeanFactoryPostProcessor` @@ -312,7 +308,6 @@ Thus, marking it for lazy initialization will be ignored, and the `Bean(Factory)PostProcessor` will be instantiated eagerly even if you set the `default-lazy-init` attribute to `true` on the declaration of your `` element. - [[beans-factory-placeholderconfigurer]] === Example: Property Placeholder Substitution with `PropertySourcesPlaceholderConfigurer` @@ -412,7 +407,6 @@ fails when it is about to be created, which is during the `preInstantiateSinglet phase of an `ApplicationContext` for a non-lazy-init bean. ===== - [[beans-factory-overrideconfigurer]] === Example: The `PropertyOverrideConfigurer` @@ -469,7 +463,6 @@ property overriding with a dedicated configuration element, as the following exa ---- - [[beans-factory-extension-factorybean]] == Customizing Instantiation Logic with a `FactoryBean` @@ -502,6 +495,3 @@ calling the `getBean()` method of the `ApplicationContext`. So, for a given `Fac with an `id` of `myBean`, invoking `getBean("myBean")` on the container returns the product of the `FactoryBean`, whereas invoking `getBean("&myBean")` returns the `FactoryBean` instance itself. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/factory-nature.adoc b/framework-docs/modules/ROOT/pages/core/beans/factory-nature.adoc index f6d310715a8..87d1cefe749 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/factory-nature.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/factory-nature.adoc @@ -9,7 +9,6 @@ of a bean. This section groups them as follows: * xref:core/beans/factory-nature.adoc#aware-list[Other `Aware` Interfaces] - [[beans-factory-lifecycle]] == Lifecycle Callbacks @@ -41,8 +40,6 @@ startup and shutdown process, as driven by the container's own lifecycle. The lifecycle callback interfaces are described in this section. - - [[beans-factory-lifecycle-initializingbean]] === Initialization Callbacks @@ -156,8 +153,6 @@ the container's overall lifecycle management, including an auto-startup mechanis a pre-destroy stop step, and potential stop/restart callbacks (see below). ==== - - [[beans-factory-lifecycle-disposablebean]] === Destruction Callbacks @@ -267,8 +262,6 @@ You may also implement `SmartLifecycle` for a time-bound stop step where the con will wait for all such stop processing to complete before moving on to destroy methods. ==== - - [[beans-factory-lifecycle-default-init-destroy-methods]] === Default Initialization and Destroy Methods @@ -369,8 +362,6 @@ interceptors to the `init` method, because doing so would couple the lifecycle o target bean to its proxy or interceptors and leave strange semantics when your code interacts directly with the raw target bean. - - [[beans-factory-lifecycle-combined-effects]] === Combining Lifecycle Mechanisms @@ -402,8 +393,6 @@ Destroy methods are called in the same order: . `destroy()` as defined by the `DisposableBean` callback interface . A custom configured `destroy()` method - - [[beans-factory-lifecycle-processor]] === Startup and Shutdown Callbacks @@ -526,8 +515,6 @@ its own `start()` method (unlike the context refresh, the context start does not automatically for a standard context implementation). The `phase` value and any "`depends-on`" relationships determine the startup order as described earlier. - - [[beans-factory-shutdown]] === Shutting Down the Spring IoC Container Gracefully in Non-Web Applications @@ -590,8 +577,6 @@ Kotlin:: ---- ====== - - [[beans-factory-thread-safety]] === Thread Safety and Visibility @@ -625,7 +610,6 @@ destroy callback without a preceding stop since this may happen during an extrao shutdown after a cancelled bootstrap or in case of a stop timeout caused by another bean. - [[beans-factory-aware]] == `ApplicationContextAware` and `BeanNameAware` @@ -682,7 +666,6 @@ initialization callback such as `InitializingBean.afterPropertiesSet()` or a cus init-method. - [[aware-list]] == Other `Aware` Interfaces @@ -747,6 +730,3 @@ dependency type. The following table summarizes the most important `Aware` inter Note again that using these interfaces ties your code to the Spring API and does not follow the Inversion of Control style. As a result, we recommend them for infrastructure beans that require programmatic access to the container. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/factory-scopes.adoc b/framework-docs/modules/ROOT/pages/core/beans/factory-scopes.adoc index df5b753514a..d5317a4d46f 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/factory-scopes.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/factory-scopes.adoc @@ -56,7 +56,6 @@ For instructions on how to register this or any other custom scope, see xref:core/beans/factory-scopes.adoc#beans-factory-scopes-custom-using[Using a Custom Scope]. - [[beans-factory-scopes-singleton]] == The Singleton Scope @@ -91,7 +90,6 @@ following example: ---- - [[beans-factory-scopes-prototype]] == The Prototype Scope @@ -134,7 +132,6 @@ be handled by the client. (For details on the lifecycle of a bean in the Spring container, see xref:core/beans/factory-nature.adoc#beans-factory-lifecycle[Lifecycle Callbacks].) - [[beans-factory-scopes-sing-prot-interaction]] == Singleton Beans with Prototype-bean Dependencies @@ -152,7 +149,6 @@ and injects its dependencies. If you need a new instance of a prototype bean at runtime more than once, see xref:core/beans/dependencies/factory-method-injection.adoc[Method Injection]. - [[beans-factory-scopes-other]] == Request, Session, Application, and WebSocket Scopes @@ -162,8 +158,6 @@ if you use a web-aware Spring `ApplicationContext` implementation (such as such as the `ClassPathXmlApplicationContext`, an `IllegalStateException` that complains about an unknown bean scope is thrown. - - [[beans-factory-scopes-other-web-configuration]] === Initial Web Configuration @@ -223,8 +217,6 @@ the same thing, namely bind the HTTP request object to the `Thread` that is serv that request. This makes beans that are request- and session-scoped available further down the call chain. - - [[beans-factory-scopes-request]] === Request scope @@ -272,8 +264,6 @@ Kotlin:: ---- ====== - - [[beans-factory-scopes-session]] === Session Scope @@ -322,8 +312,6 @@ Kotlin:: ---- ====== - - [[beans-factory-scopes-application]] === Application Scope @@ -371,8 +359,6 @@ Kotlin:: ---- ====== - - [[beans-factory-scopes-websocket]] === WebSocket Scope @@ -380,8 +366,6 @@ WebSocket scope is associated with the lifecycle of a WebSocket session and appl STOMP over WebSocket applications, see xref:web/websocket/stomp/scope.adoc[WebSocket scope] for more details. - - [[beans-factory-scopes-other-injection]] === Scoped Beans as Dependencies @@ -539,8 +523,6 @@ interfaces. The following example shows a proxy based on an interface: For more detailed information about choosing class-based or interface-based proxying, see xref:core/aop/proxying.adoc[Proxying Mechanisms]. - - [[beans-factory-scopes-injection]] === Injecting Request/Session References Directly @@ -553,7 +535,6 @@ objects which has the advantage of working in singleton beans and serializable b as well, similar to scoped proxies for factory-scoped beans. - [[beans-factory-scopes-custom]] == Custom Scopes @@ -561,7 +542,6 @@ The bean scoping mechanism is extensible. You can define your own scopes or even redefine existing scopes, although the latter is considered bad practice and you cannot override the built-in `singleton` and `prototype` scopes. - [[beans-factory-scopes-custom-creating]] === Creating a Custom Scope @@ -664,8 +644,6 @@ Kotlin:: This identifier is different for each scope. For a session scoped implementation, this identifier can be the session identifier. - - [[beans-factory-scopes-custom-using]] === Using a Custom Scope @@ -773,7 +751,3 @@ of the scope. You can also do the `Scope` registration declaratively, by using t NOTE: When you place `` within a `` declaration for a `FactoryBean` implementation, it is the factory bean itself that is scoped, not the object returned from `getObject()`. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/introduction.adoc b/framework-docs/modules/ROOT/pages/core/beans/introduction.adoc index 969cbed145f..c4728cfff56 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/introduction.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/introduction.adoc @@ -37,7 +37,3 @@ by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the dependencies among them, are reflected in the configuration metadata used by a container. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java.adoc b/framework-docs/modules/ROOT/pages/core/beans/java.adoc index 8f3f9f7aac0..86ca51e3721 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java.adoc @@ -4,4 +4,3 @@ This section covers how to use annotations in your Java code to configure the Spring container. - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java/basic-concepts.adoc b/framework-docs/modules/ROOT/pages/core/beans/java/basic-concepts.adoc index 80e28de0a8f..adc615e35ea 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java/basic-concepts.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java/basic-concepts.adoc @@ -84,6 +84,3 @@ subclassing has to be applied at runtime, reducing the overhead and the footprin The `@Bean` and `@Configuration` annotations are discussed in depth in the following sections. First, however, we cover the various ways of creating a Spring container by using Java-based configuration. - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java/bean-annotation.adoc b/framework-docs/modules/ROOT/pages/core/beans/java/bean-annotation.adoc index dcc181d5158..e0811fc509b 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java/bean-annotation.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java/bean-annotation.adoc @@ -468,6 +468,7 @@ Kotlin:: ---- ====== + [[beans-java-customizing-bean-naming]] == Customizing Bean Naming @@ -585,6 +586,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java/composing-configuration-classes.adoc b/framework-docs/modules/ROOT/pages/core/beans/java/composing-configuration-classes.adoc index 0ef19ea633c..6b99094ad0e 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java/composing-configuration-classes.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java/composing-configuration-classes.adoc @@ -905,4 +905,3 @@ Kotlin:: } ---- ====== - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java/configuration-annotation.adoc b/framework-docs/modules/ROOT/pages/core/beans/java/configuration-annotation.adoc index 0ed5254a1a8..2e17543405b 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java/configuration-annotation.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java/configuration-annotation.adoc @@ -4,7 +4,9 @@ `@Configuration` is a class-level annotation indicating that an object is a source of bean definitions. `@Configuration` classes declare beans through `@Bean`-annotated methods. Calls to `@Bean` methods on `@Configuration` classes can also be used to define -inter-bean dependencies. See xref:core/beans/java/basic-concepts.adoc[Basic Concepts: `@Bean` and `@Configuration`] for a general introduction. +inter-bean dependencies. See +xref:core/beans/java/basic-concepts.adoc[Basic Concepts: `@Bean` and `@Configuration`] +for a general introduction. [[beans-java-injecting-dependencies]] @@ -58,7 +60,6 @@ is declared within a `@Configuration` class. You cannot declare inter-bean depen by using plain `@Component` classes. - [[beans-java-method-injection]] == Lookup Method Injection @@ -259,6 +260,3 @@ instead) or by annotating your configuration class with are then not intercepted, so you have to exclusively rely on dependency injection at the constructor or method level there. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/java/instantiating-container.adoc b/framework-docs/modules/ROOT/pages/core/beans/java/instantiating-container.adoc index 3618e839043..87cb5f91d68 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/java/instantiating-container.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/java/instantiating-container.adoc @@ -206,7 +206,8 @@ Kotlin:: ---- ====== -NOTE: Remember that `@Configuration` classes are xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotated] +NOTE: Remember that `@Configuration` classes are +xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotated] with `@Component`, so they are candidates for component-scanning. In the preceding example, assuming that `AppConfig` is declared within the `com.acme` package (or any package underneath), it is picked up during the call to `scan()`. Upon `refresh()`, all its `@Bean` @@ -280,5 +281,3 @@ NOTE: For programmatic use cases, a `GenericWebApplicationContext` can be used a alternative to `AnnotationConfigWebApplicationContext`. See the {spring-framework-api}/web/context/support/GenericWebApplicationContext.html[`GenericWebApplicationContext`] javadoc for details. - - diff --git a/framework-docs/modules/ROOT/pages/core/beans/standard-annotations.adoc b/framework-docs/modules/ROOT/pages/core/beans/standard-annotations.adoc index 666edbeb614..146a238eb84 100644 --- a/framework-docs/modules/ROOT/pages/core/beans/standard-annotations.adoc +++ b/framework-docs/modules/ROOT/pages/core/beans/standard-annotations.adoc @@ -23,7 +23,6 @@ You can add the following dependency to your file pom.xml: ===== - [[beans-inject-named]] == Dependency Injection with `@Inject` and `@Named` @@ -214,7 +213,6 @@ Kotlin:: ====== - [[beans-named]] == `@Named` and `@ManagedBean`: Standard Equivalents to the `@Component` Annotation @@ -339,7 +337,6 @@ annotations are not composable. You should use Spring's stereotype model for bui custom component annotations. - [[beans-standard-annotations-limitations]] == Limitations of JSR-330 Standard Annotations @@ -388,6 +385,3 @@ features are not available, as the following table shows: only with a shorter `get()` method name. It can also be used in combination with Spring's `@Autowired` or with non-annotated constructors and setter methods. |=== - - - diff --git a/framework-docs/modules/ROOT/pages/core/databuffer-codec.adoc b/framework-docs/modules/ROOT/pages/core/databuffer-codec.adoc index d25bd976989..cdd8c6c15a7 100644 --- a/framework-docs/modules/ROOT/pages/core/databuffer-codec.adoc +++ b/framework-docs/modules/ROOT/pages/core/databuffer-codec.adoc @@ -15,8 +15,6 @@ xref:core/databuffer-codec.adoc#databuffers-buffer-pooled[pooled]. * <> decode or encode data buffer streams into higher level objects. - - [[databuffers-factory]] == `DataBufferFactory` @@ -33,8 +31,6 @@ The type of factory depends on the underlying client or server, for example, `NettyDataBufferFactory` for Reactor Netty, `DefaultDataBufferFactory` for others. - - [[databuffers-buffer]] == `DataBuffer` @@ -50,8 +46,6 @@ alternate between read and write. * Determine the index, or the last index, for a given byte. - - [[databuffers-buffer-pooled]] == `PooledDataBuffer` @@ -75,8 +69,6 @@ to use the convenience methods in `DataBufferUtils` that apply release or retain `DataBuffer` only if it is an instance of `PooledDataBuffer`. - - [[databuffers-utils]] == `DataBufferUtils` @@ -91,8 +83,6 @@ composite buffers, if that's supported by the underlying byte buffer API. * Skip or take from a stream of bytes until a specific byte count. - - [[codecs]] == Codecs @@ -107,8 +97,6 @@ Jackson Smile, JAXB2, Protocol Buffers and other encoders and decoders. See xref:web/webflux/reactive-spring.adoc#webflux-codecs[Codecs] in the WebFlux section. - - [[databuffers-using]] == Using `DataBuffer` diff --git a/framework-docs/modules/ROOT/pages/core/expressions.adoc b/framework-docs/modules/ROOT/pages/core/expressions.adoc index 7700929f7b6..48e6e4f5e37 100644 --- a/framework-docs/modules/ROOT/pages/core/expressions.adoc +++ b/framework-docs/modules/ROOT/pages/core/expressions.adoc @@ -54,4 +54,3 @@ The expression language supports the following functionality: * Collection projection * Collection selection * Templated expressions - diff --git a/framework-docs/modules/ROOT/pages/core/expressions/evaluation.adoc b/framework-docs/modules/ROOT/pages/core/expressions/evaluation.adoc index bf253821b4e..2501e72e4b3 100644 --- a/framework-docs/modules/ROOT/pages/core/expressions/evaluation.adoc +++ b/framework-docs/modules/ROOT/pages/core/expressions/evaluation.adoc @@ -217,8 +217,6 @@ Kotlin:: ====== - - [[expressions-evaluation-context]] == Understanding `EvaluationContext` @@ -255,7 +253,6 @@ properties. Alternatively, configure custom accessors via `SimpleEvaluationContext.forPropertyAccessors(...)`, potentially disable assignment, and optionally activate method resolution and/or a type converter through the builder. - [[expressions-type-conversion]] === Type Conversion @@ -431,7 +428,6 @@ numeric operations, the performance gain can be very noticeable. In an example m benchmark run of 50,000 iterations, it took 75ms to evaluate by using the interpreter and only 3ms using the compiled version of the expression. - [[expressions-compiler-configuration]] === Compiler Configuration @@ -524,7 +520,6 @@ property via a JVM system property (or via the xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism) to one of the `SpelCompilerMode` enum values (`off`, `immediate`, or `mixed`). - [[expressions-compiler-limitations]] === Compiler Limitations @@ -541,4 +536,3 @@ following kinds of expressions cannot be compiled. * Expressions using bean references Compilation of additional kinds of expressions may be supported in the future. - diff --git a/framework-docs/modules/ROOT/pages/core/null-safety.adoc b/framework-docs/modules/ROOT/pages/core/null-safety.adoc index 8e2fe8ed42b..4d28201d0c0 100644 --- a/framework-docs/modules/ROOT/pages/core/null-safety.adoc +++ b/framework-docs/modules/ROOT/pages/core/null-safety.adoc @@ -27,8 +27,6 @@ use a similar nullability arrangement, delivering a consistent overall experienc Spring application developers. - - [[use-cases]] == Use cases @@ -41,8 +39,6 @@ supports {kotlin-docs}/null-safety.html[null-safety]. More details are available in the xref:languages/kotlin/null-safety.adoc[Kotlin support documentation]. - - [[jsr-305-meta-annotations]] == JSR-305 meta-annotations diff --git a/framework-docs/modules/ROOT/pages/core/resources.adoc b/framework-docs/modules/ROOT/pages/core/resources.adoc index dee9df4f1ab..ae5b7acdef4 100644 --- a/framework-docs/modules/ROOT/pages/core/resources.adoc +++ b/framework-docs/modules/ROOT/pages/core/resources.adoc @@ -14,8 +14,6 @@ Spring. It includes the following topics: * xref:core/resources.adoc#resources-app-ctx[Application Contexts and Resource Paths] - - [[resources-introduction]] == Introduction @@ -29,8 +27,6 @@ quite complicated, and the `URL` interface still lacks some desirable functional such as a method to check for the existence of the resource being pointed to. - - [[resources-resource]] == The `Resource` Interface @@ -121,11 +117,8 @@ While this couples your code to Spring, it really only couples it to this small utility classes, which serves as a more capable replacement for `URL` and can be considered equivalent to any other library you would use for this purpose. -NOTE: The `Resource` abstraction does not replace functionality. It wraps it where -possible. For example, a `UrlResource` wraps a URL and uses the wrapped `URL` to do its -work. - - +NOTE: The `Resource` abstraction does not replace functionality. It wraps it where possible. +For example, a `UrlResource` wraps a URL and uses the wrapped `URL` to do its work. [[resources-implementations]] @@ -145,8 +138,6 @@ For a complete list of `Resource` implementations available in Spring, consult t "All Known Implementing Classes" section of the {spring-framework-api}/core/io/Resource.html[`Resource`] javadoc. - - [[resources-implementations-urlresource]] === `UrlResource` @@ -165,8 +156,6 @@ well-known (to property editor, that is) prefix (such as `classpath:`), it creat appropriate specialized `Resource` for that prefix. However, if it does not recognize the prefix, it assumes the string is a standard URL string and creates a `UrlResource`. - - [[resources-implementations-classpathresource]] === `ClassPathResource` @@ -186,8 +175,6 @@ constructor but is often created implicitly when you call an API method that tak `PropertyEditor` recognizes the special prefix, `classpath:`, on the string path and creates a `ClassPathResource` in that case. - - [[resources-implementations-filesystemresource]] === `FileSystemResource` @@ -197,8 +184,6 @@ transformations but performing all operations via the `java.nio.file.Files` API. `java.nio.path.Path` based support use a `PathResource` instead. `FileSystemResource` supports resolution as a `File` and as a `URL`. - - [[resources-implementations-pathresource]] === `PathResource` @@ -208,8 +193,6 @@ as a `URL` and also implements the extended `WritableResource` interface. `PathR is effectively a pure `java.nio.path.Path` based alternative to `FileSystemResource` with different `createRelative` behavior. - - [[resources-implementations-servletcontextresource]] === `ServletContextResource` @@ -222,8 +205,6 @@ filesystem. Whether or not it is expanded and on the filesystem or accessed directly from the JAR or somewhere else like a database (which is conceivable) is actually dependent on the Servlet container. - - [[resources-implementations-inputstreamresource]] === `InputStreamResource` @@ -237,8 +218,6 @@ already-opened resource. Therefore, it returns `true` from `isOpen()`. Do not us you need to keep the resource descriptor somewhere or if you need to read a stream multiple times. - - [[resources-implementations-bytearrayresource]] === `ByteArrayResource` @@ -249,8 +228,6 @@ It is useful for loading content from any given byte array without having to res single-use `InputStreamResource`. - - [[resources-resourceloader]] == The `ResourceLoader` Interface @@ -385,8 +362,6 @@ objects: |=== - - [[resources-resourcepatternresolver]] == The `ResourcePatternResolver` Interface @@ -436,8 +411,6 @@ implements the `ResourcePatternResolver` interface and delegates to the default ==== - - [[resources-resourceloaderaware]] == The `ResourceLoaderAware` Interface @@ -483,8 +456,6 @@ xref:core/resources.adoc#resources-resourcepatternresolver[`ResourcePatternResol application components instead of `ResourceLoader`. - - [[resources-as-dependencies]] == Resources as Dependencies @@ -631,16 +602,12 @@ Kotlin:: ====== - - [[resources-app-ctx]] == Application Contexts and Resource Paths This section covers how to create application contexts with resources, including shortcuts that work with XML, how to use wildcards, and other details. - - [[resources-app-ctx-construction]] === Constructing Application Contexts @@ -720,7 +687,6 @@ Using `FileSystemXmlApplicationContext` loads the bean definitions from the clas However, it is still a `FileSystemXmlApplicationContext`. If it is subsequently used as a `ResourceLoader`, any unprefixed paths are still treated as filesystem paths. - [[resources-app-ctx-classpathxml]] ==== Constructing `ClassPathXmlApplicationContext` Instances -- Shortcuts @@ -766,8 +732,6 @@ Kotlin:: See the {spring-framework-api}/context/support/ClassPathXmlApplicationContext.html[`ClassPathXmlApplicationContext`] javadoc for details on the various constructors. - - [[resources-app-ctx-wildcards-in-resource-paths]] === Wildcards in Application Context Constructor Resource Paths @@ -788,7 +752,6 @@ resolved at construction time. It has nothing to do with the `Resource` type its You cannot use the `classpath*:` prefix to construct an actual `Resource`, as a resource points to just one resource at a time. - [[resources-app-ctx-ant-patterns-in-paths]] ==== Ant-style Patterns @@ -832,7 +795,6 @@ walk the contents of the jar and resolve the wildcard. This does work in most en but fails in others, and we strongly recommend that the wildcard resolution of resources coming from jars be thoroughly tested in your specific environment before you rely on it. - [[resources-classpath-wildcards]] ==== The `classpath*:` Prefix @@ -880,7 +842,6 @@ used on the last non-wildcard path segment to get all the matching resources in class loader hierarchy and then, off each resource, the same `PathMatcher` resolution strategy described earlier is used for the wildcard subpath. - [[resources-wildcards-in-path-other-stuff]] ==== Other Notes Relating to Wildcards @@ -934,8 +895,6 @@ location found. Therefore, in such cases you should prefer using `classpath*:` w same Ant-style pattern, which searches all classpath locations that contain the `com.mycompany` base package: `classpath*:com/mycompany/**/service-context.xml`. - - [[resources-filesystemresource-caveats]] === `FileSystemResource` Caveats diff --git a/framework-docs/modules/ROOT/pages/core/validation.adoc b/framework-docs/modules/ROOT/pages/core/validation.adoc index cc55989412c..2f7fe17cc5c 100644 --- a/framework-docs/modules/ROOT/pages/core/validation.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation.adoc @@ -30,11 +30,8 @@ implementations. They are also discussed in this chapter. Spring supports Java Bean Validation through setup infrastructure and an adaptor to Spring's own `Validator` contract. Applications can enable Bean Validation once globally, -as described in xref:core/validation/beanvalidation.adoc[Java Bean Validation], and use it exclusively for all validation -needs. In the web layer, applications can further register controller-local Spring -`Validator` instances per `DataBinder`, as described in xref:core/validation/beanvalidation.adoc#validation-binder[Configuring a `DataBinder`], which can -be useful for plugging in custom validation logic. - - - - +as described in xref:core/validation/beanvalidation.adoc[Java Bean Validation], and use +it exclusively for all validation needs. In the web layer, applications can further +register controller-local Spring `Validator` instances per `DataBinder`, as described in +xref:core/validation/beanvalidation.adoc#validation-binder[Configuring a `DataBinder`], +which can be useful for plugging in custom validation logic. diff --git a/framework-docs/modules/ROOT/pages/core/validation/beans-beans.adoc b/framework-docs/modules/ROOT/pages/core/validation/beans-beans.adoc index d522a57c990..2a968765e22 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/beans-beans.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/beans-beans.adoc @@ -703,7 +703,3 @@ This style of `PropertyEditor` registration can lead to concise code (the implem of the `@InitBinder` method is only one line long) and lets common `PropertyEditor` registration code be encapsulated in a class and then shared amongst as many controllers as needed. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/validation/beanvalidation.adoc b/framework-docs/modules/ROOT/pages/core/validation/beanvalidation.adoc index f5d83d4ad70..4a810b98a70 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/beanvalidation.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/beanvalidation.adoc @@ -5,7 +5,6 @@ The Spring Framework provides support for the {bean-validation-site}[Java Bean Validation] API. - [[validation-beanvalidation-overview]] == Overview of Bean Validation @@ -78,7 +77,6 @@ specific constraints. To learn how to set up a bean validation provider as a Spr bean, keep reading. - [[validation-beanvalidation-spring]] == Configuring a Bean Validation Provider @@ -121,7 +119,6 @@ The basic configuration in the preceding example triggers bean validation to ini using its default bootstrap mechanism. A Bean Validation provider, such as the Hibernate Validator, is expected to be present in the classpath and is automatically detected. - [[validation-beanvalidation-spring-inject]] === Inject Jakarta Validator @@ -157,7 +154,6 @@ Kotlin:: ---- ====== - [[validation-beanvalidation-spring-inject-adapter]] === Inject Spring Validator @@ -199,8 +195,6 @@ invokes the underlying `jakarta.validation.Validator`, and then adapts ``ConstraintViolation``s to ``FieldError``s, and registers them with the `Errors` object passed into the `validate` method. - - [[validation-beanvalidation-spring-constraints]] === Configure Custom Constraints @@ -276,7 +270,6 @@ Kotlin:: ---- ====== - As the preceding example shows, a `ConstraintValidator` implementation can have its dependencies `@Autowired` as any other Spring bean. @@ -311,7 +304,6 @@ xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses] sections, and the xref:web/webflux/controller/ann-validation.adoc[Validation] and xref:web/webflux/ann-rest-exceptions.adoc[Error Responses] sections. - [[validation-beanvalidation-spring-method-exceptions]] === Method Validation Exceptions @@ -330,7 +322,6 @@ fields and properties, the `ParameterValidationResult` is `ParameterErrors` whic implements `org.springframework.validation.Errors` and exposes validation errors as ``FieldError``s. - [[validation-beanvalidation-spring-method-i18n]] === Customizing Validation Errors @@ -411,7 +402,6 @@ Properties:: Max.degrees=You cannot provide more than {1} {0} ---- - [[validation-beanvalidation-spring-other]] === Additional Configuration Options @@ -422,7 +412,6 @@ constructs, from message interpolation to traversal resolution. See the javadoc for more information on these options. - [[validation-binder]] == Configuring a `DataBinder` @@ -479,8 +468,7 @@ locally on a DataBinder instance. See xref:web/webmvc/mvc-config/validation.adoc[Spring MVC Validation Configuration]. - [[validation-mvc]] -== Spring MVC 3 Validation +== Spring MVC Validation See xref:web/webmvc/mvc-config/validation.adoc[Validation] in the Spring MVC chapter. diff --git a/framework-docs/modules/ROOT/pages/core/validation/conversion.adoc b/framework-docs/modules/ROOT/pages/core/validation/conversion.adoc index 37c62169572..74851327c53 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/conversion.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/conversion.adoc @@ -22,7 +22,3 @@ in the javadoc of {spring-framework-api}/validation/MessageCodesResolver.html[`MessageCodesResolver`] and {spring-framework-api}/validation/DefaultMessageCodesResolver.html[`DefaultMessageCodesResolver`], respectively. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/validation/convert.adoc b/framework-docs/modules/ROOT/pages/core/validation/convert.adoc index 6b710babc96..94cdd282862 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/convert.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/convert.adoc @@ -9,7 +9,6 @@ the required property types. You can also use the public API anywhere in your ap where type conversion is needed. - [[core-convert-Converter-API]] == Converter SPI @@ -54,7 +53,6 @@ The following listing shows the `StringToInteger` class, which is a typical `Con ---- - [[core-convert-ConverterFactory-SPI]] == Using `ConverterFactory` @@ -146,7 +144,6 @@ NOTE: Because `GenericConverter` is a more complex SPI interface, you should use it only when you need it. Favor `Converter` or `ConverterFactory` for basic type conversion needs. - [[core-convert-ConditionalGenericConverter-SPI]] === Using `ConditionalGenericConverter` @@ -175,7 +172,6 @@ might match only if the target entity type declares a static finder method (for `matches(TypeDescriptor, TypeDescriptor)`. - [[core-convert-ConversionService-API]] == The `ConversionService` API @@ -208,7 +204,6 @@ use in most environments. `ConversionServiceFactory` provides a convenient facto creating common `ConversionService` configurations. - [[core-convert-Spring-config]] == Configuring a `ConversionService` @@ -256,7 +251,6 @@ xref:core/validation/format.adoc#format-FormatterRegistry-SPI[The `FormatterRegi for details on using `FormattingConversionServiceFactoryBean`. - [[core-convert-programmatic-usage]] == Using a `ConversionService` Programmatically diff --git a/framework-docs/modules/ROOT/pages/core/validation/format-configuring-formatting-globaldatetimeformat.adoc b/framework-docs/modules/ROOT/pages/core/validation/format-configuring-formatting-globaldatetimeformat.adoc index 1b67d8467a1..f14380caee5 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/format-configuring-formatting-globaldatetimeformat.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/format-configuring-formatting-globaldatetimeformat.adoc @@ -19,6 +19,3 @@ Note there are extra considerations when configuring date and time formats in we applications. Please see xref:web/webmvc/mvc-config/conversion.adoc[WebMVC Conversion and Formatting] or xref:web/webflux/config.adoc#webflux-config-conversion[WebFlux Conversion and Formatting]. - - - diff --git a/framework-docs/modules/ROOT/pages/core/validation/format.adoc b/framework-docs/modules/ROOT/pages/core/validation/format.adoc index 1d8dea34d2d..1ab37bdc15a 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/format.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/format.adoc @@ -26,7 +26,6 @@ application) and need to parse and print localized field values. The `Conversion provides a unified type conversion API for both SPIs. - [[format-Formatter-SPI]] == The `Formatter` SPI @@ -143,7 +142,6 @@ The Spring team welcomes community-driven `Formatter` contributions. See {spring-framework-issues}[GitHub Issues] to contribute. - [[format-CustomFormatAnnotations]] == Annotation-driven Formatting @@ -275,7 +273,6 @@ Kotlin:: ---- ====== - [[format-annotations-api]] === Format Annotation API @@ -335,6 +332,7 @@ https://github.com/spring-projects/spring-framework/wiki/Date-and-Time-Formattin page in the Spring Framework wiki. ==== + [[format-FormatterRegistry-SPI]] == The `FormatterRegistry` SPI @@ -376,7 +374,6 @@ annotation are formatted in a certain way. With a shared `FormatterRegistry`, yo these rules once, and they are applied whenever formatting is needed. - [[format-FormatterRegistrar-SPI]] == The `FormatterRegistrar` SPI @@ -401,12 +398,7 @@ registering a `Printer`/`Parser` pair. The next section provides more informatio converter and formatter registration. - [[format-configuring-formatting-mvc]] == Configuring Formatting in Spring MVC See xref:web/webmvc/mvc-config/conversion.adoc[Conversion and Formatting] in the Spring MVC chapter. - - - - diff --git a/framework-docs/modules/ROOT/pages/core/validation/validator.adoc b/framework-docs/modules/ROOT/pages/core/validation/validator.adoc index 1d446814a10..f1471f3a60a 100644 --- a/framework-docs/modules/ROOT/pages/core/validation/validator.adoc +++ b/framework-docs/modules/ROOT/pages/core/validation/validator.adoc @@ -201,6 +201,3 @@ not involving a binding process. As of 6.1, this has been simplified through a n a simple `Errors` representation which can be inspected: typically calling `hasErrors()` or the new `failOnError` method for turning the error summary message into an exception (for example, `validator.validateObject(myObject).failOnError(IllegalArgumentException::new)`). - - - diff --git a/framework-docs/modules/ROOT/pages/data-access.adoc b/framework-docs/modules/ROOT/pages/data-access.adoc index df232e910fa..a1db0cf1137 100644 --- a/framework-docs/modules/ROOT/pages/data-access.adoc +++ b/framework-docs/modules/ROOT/pages/data-access.adoc @@ -8,7 +8,3 @@ interaction between the data access layer and the business or service layer. Spring's comprehensive transaction management support is covered in some detail, followed by thorough coverage of the various data access frameworks and technologies with which the Spring Framework integrates. - - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/appendix.adoc b/framework-docs/modules/ROOT/pages/data-access/appendix.adoc index 4374af3b7e2..db268abfbbe 100644 --- a/framework-docs/modules/ROOT/pages/data-access/appendix.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/appendix.adoc @@ -2,8 +2,6 @@ = Appendix - - [[xsd-schemas]] == XML Schemas @@ -12,8 +10,6 @@ This part of the appendix lists XML schemas for data access, including the follo * xref:data-access/appendix.adoc#xsd-schemas-tx[The `tx` Schema] * xref:data-access/appendix.adoc#xsd-schemas-jdbc[The `jdbc` Schema] - - [[xsd-schemas-tx]] === The `tx` Schema @@ -61,8 +57,6 @@ implemented by using AOP). The preceding XML snippet contains the relevant lines to reference the `aop` schema so that the elements in the `aop` namespace are available to you. - - [[xsd-schemas-jdbc]] === The `jdbc` Schema diff --git a/framework-docs/modules/ROOT/pages/data-access/dao.adoc b/framework-docs/modules/ROOT/pages/data-access/dao.adoc index f4c1accbb00..4ed57c4a201 100644 --- a/framework-docs/modules/ROOT/pages/data-access/dao.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/dao.adoc @@ -8,7 +8,6 @@ and it also lets you code without worrying about catching exceptions that are specific to each technology. - [[dao-exceptions]] == Consistent Exception Hierarchy @@ -42,7 +41,6 @@ The following image shows the exception hierarchy that Spring provides. image::DataAccessException.png[] - [[dao-annotations]] == Annotations Used to Configure DAO or Repository Classes @@ -192,7 +190,3 @@ Kotlin:: NOTE: See the specific coverage of each persistence technology for details on how to configure the application context to take advantage of these annotations. - - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc.adoc index 0f82cea1b64..069e6a7849d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc.adoc @@ -53,6 +53,3 @@ takes care of and which actions are your responsibility. The Spring Framework takes care of all the low-level details that can make JDBC such a tedious API. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/advanced.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/advanced.adoc index 91786b3dbde..ee48bda1d59 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/advanced.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/advanced.adoc @@ -312,6 +312,3 @@ each batch should be the batch size provided for all batches (except that the la that might be less), depending on the total number of update objects provided. The update count for each update statement is the one reported by the JDBC driver. If the count is not available, the JDBC driver returns a value of `-2`. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/choose-style.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/choose-style.adoc index 863b8f1cdac..e588c825448 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/choose-style.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/choose-style.adoc @@ -22,6 +22,3 @@ and match to include a feature from a different approach. data-access layer. This approach allows you to define your query string, declare parameters, and compile the query. Once you do that, `execute(...)`, `update(...)`, and `findObject(...)` methods can be called multiple times with various parameter values. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/connections.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/connections.adoc index d862ef88386..ca8b107ccd1 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/connections.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/connections.adoc @@ -62,6 +62,7 @@ The following example shows C3P0 configuration: include-code::./ComboPooledDataSourceConfiguration[tag=snippet,indent=0] + [[jdbc-DataSourceUtils]] == Using `DataSourceUtils` @@ -196,6 +197,3 @@ In terms of exception behavior, `JdbcTransactionManager` is roughly equivalent t `JpaTransactionManager` and also to `R2dbcTransactionManager`, serving as an immediate companion/replacement for each other. `DataSourceTransactionManager` on the other hand is equivalent to `JtaTransactionManager` and can serve as a direct replacement there. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc index 7f4eaf6be89..9fa68312f59 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/core.adoc @@ -1081,6 +1081,3 @@ Kotlin:: // keyHolder.getKey() now contains the generated key ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/embedded-database-support.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/embedded-database-support.adoc index 83ccd98d84b..9090a4b17d5 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/embedded-database-support.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/embedded-database-support.adoc @@ -255,6 +255,3 @@ You can extend Spring JDBC embedded database support in two ways: We encourage you to contribute extensions to the Spring community at {spring-framework-issues}[GitHub Issues]. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/initializing-datasource.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/initializing-datasource.adoc index c1799983566..621f1421a13 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/initializing-datasource.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/initializing-datasource.adoc @@ -141,6 +141,3 @@ Ensuring that the database initializer is initialized first can also be easy. So parent context contains the `DataSource`, and the child context contains the business components). This structure is common in Spring web applications but can be more generally applied. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/object.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/object.adoc index dc3c135ae52..65b1770215d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/object.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/object.adoc @@ -599,6 +599,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/packages.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/packages.adoc index f2b739def9b..d55ca6c955a 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/packages.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/packages.adoc @@ -8,7 +8,9 @@ and its various callback interfaces, plus a variety of related classes. A subpac named `org.springframework.jdbc.core.simple` contains the `SimpleJdbcInsert` and `SimpleJdbcCall` classes. Another subpackage named `org.springframework.jdbc.core.namedparam` contains the `NamedParameterJdbcTemplate` -class and the related support classes. See xref:data-access/jdbc/core.adoc[Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling], xref:data-access/jdbc/advanced.adoc[JDBC Batch Operations], and +class and the related support classes. See +xref:data-access/jdbc/core.adoc[Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling], +xref:data-access/jdbc/advanced.adoc[JDBC Batch Operations], and xref:data-access/jdbc/simple.adoc[Simplifying JDBC Operations with the `SimpleJdbc` Classes]. * `datasource`: The `org.springframework.jdbc.datasource` package contains a utility class @@ -16,7 +18,8 @@ for easy `DataSource` access and various simple `DataSource` implementations tha use for testing and running unmodified JDBC code outside of a Jakarta EE container. A subpackage named `org.springframework.jdbc.datasource.embedded` provides support for creating embedded databases by using Java database engines, such as HSQL, H2, and Derby. See -xref:data-access/jdbc/connections.adoc[Controlling Database Connections] and xref:data-access/jdbc/embedded-database-support.adoc[Embedded Database Support]. +xref:data-access/jdbc/connections.adoc[Controlling Database Connections] and +xref:data-access/jdbc/embedded-database-support.adoc[Embedded Database Support]. * `object`: The `org.springframework.jdbc.object` package contains classes that represent RDBMS queries, updates, and stored procedures as thread-safe, reusable objects. See @@ -31,7 +34,5 @@ are translated to exceptions defined in the `org.springframework.dao` package. T that code using the Spring JDBC abstraction layer does not need to implement JDBC or RDBMS-specific error handling. All translated exceptions are unchecked, which gives you the option of catching the exceptions from which you can recover while letting other -exceptions be propagated to the caller. See xref:data-access/jdbc/core.adoc#jdbc-SQLExceptionTranslator[Using `SQLExceptionTranslator`]. - - - +exceptions be propagated to the caller. See +xref:data-access/jdbc/core.adoc#jdbc-SQLExceptionTranslator[Using `SQLExceptionTranslator`]. diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/parameter-handling.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/parameter-handling.adoc index 3a9edff0ccb..b2809957baf 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/parameter-handling.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/parameter-handling.adoc @@ -231,4 +231,3 @@ access by unwrapping it. You can use the `SqlTypeValue` to create an array and p it with values from the Java `java.sql.Array`, as the following example shows: include-code::./SqlTypeValueFactory[tag=oracle-array,indent=0] - diff --git a/framework-docs/modules/ROOT/pages/data-access/jdbc/simple.adoc b/framework-docs/modules/ROOT/pages/data-access/jdbc/simple.adoc index 27c3e689835..aebbdb14049 100644 --- a/framework-docs/modules/ROOT/pages/data-access/jdbc/simple.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/jdbc/simple.adoc @@ -768,6 +768,3 @@ Kotlin:: The `execute` call passes in an empty `Map`, because this call does not take any parameters. The list of actors is then retrieved from the results map and returned to the caller. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/orm.adoc b/framework-docs/modules/ROOT/pages/data-access/orm.adoc index c4f0acb9c86..8e445b17041 100644 --- a/framework-docs/modules/ROOT/pages/data-access/orm.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/orm.adoc @@ -3,6 +3,3 @@ :page-section-summary-toc: 1 This section covers data access when you use Object Relational Mapping (ORM). - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/orm/general.adoc b/framework-docs/modules/ROOT/pages/data-access/orm/general.adoc index bbbd6b8b454..49ceefcbad6 100644 --- a/framework-docs/modules/ROOT/pages/data-access/orm/general.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/orm/general.adoc @@ -109,6 +109,3 @@ In summary, you can implement DAOs based on the plain persistence technology's A annotations while still benefiting from Spring-managed transactions, dependency injection, and transparent exception conversion (if desired) to Spring's custom exception hierarchies. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc b/framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc index f83b433f282..445bf43d27d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc @@ -515,6 +515,3 @@ the following events occur when a JTA transaction commits: * Hibernate is synchronized to the JTA transaction, so the transaction is called back through an `afterCompletion` callback by the JTA transaction manager and can properly clear its cache. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/orm/introduction.adoc b/framework-docs/modules/ROOT/pages/data-access/orm/introduction.adoc index d44aca0c20d..e33a44af7aa 100644 --- a/framework-docs/modules/ROOT/pages/data-access/orm/introduction.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/orm/introduction.adoc @@ -48,7 +48,8 @@ The benefits of using the Spring Framework to create your ORM DAOs include: aspect-oriented programming (AOP) style method interceptor either through the `@Transactional` annotation or by explicitly configuring the transaction AOP advice in an XML configuration file. In both cases, transaction semantics and exception handling - (rollback and so on) are handled for you. As discussed in xref:data-access/orm/general.adoc#orm-resource-mngmnt[Resource and Transaction Management], + (rollback and so on) are handled for you. As discussed in + xref:data-access/orm/general.adoc#orm-resource-mngmnt[Resource and Transaction Management], you can also swap various transaction managers, without affecting your ORM-related code. For example, you can swap between local transactions and JTA, with the same full services (such as declarative transactions) available in both scenarios. Additionally, @@ -61,6 +62,3 @@ technologies such as MongoDB, you might want to check out the {spring-site-projects}/spring-data/[Spring Data] suite of projects. If you are a JPA user, the {spring-site-guides}/gs/accessing-data-jpa/[Getting Started Accessing Data with JPA] guide from https://spring.io provides a great introduction. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/orm/jpa.adoc b/framework-docs/modules/ROOT/pages/data-access/orm/jpa.adoc index 011f1033ad0..8843a46b727 100644 --- a/framework-docs/modules/ROOT/pages/data-access/orm/jpa.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/orm/jpa.adoc @@ -627,7 +627,3 @@ On `LocalSessionFactoryBean`, this is available through the `bootstrapExecutor` property. On the programmatic `LocalSessionFactoryBuilder`, an overloaded `buildSessionFactory` method takes a bootstrap executor argument. ==== - - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/oxm.adoc b/framework-docs/modules/ROOT/pages/data-access/oxm.adoc index 3296f532933..e2914c19e68 100644 --- a/framework-docs/modules/ROOT/pages/data-access/oxm.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/oxm.adoc @@ -2,7 +2,6 @@ = Marshalling XML by Using Object-XML Mappers - [[oxm-introduction]] == Introduction @@ -22,7 +21,6 @@ Some of the benefits of using Spring for your O/X mapping needs are: * xref:data-access/oxm.adoc#oxm-consistent-interfaces[Consistent Interfaces] * xref:data-access/oxm.adoc#oxm-consistent-exception-hierarchy[Consistent Exception Hierarchy] - [[oxm-ease-of-configuration]] === Ease of configuration @@ -32,7 +30,6 @@ as you would any other bean in your application context. Additionally, XML names configuration is available for a number of marshallers, making the configuration even simpler. - [[oxm-consistent-interfaces]] === Consistent Interfaces @@ -44,7 +41,6 @@ marshalling with a mix-and-match approach (for example, some marshalling perform and some by XStream) in a non-intrusive fashion, letting you use the strength of each technology. - [[oxm-consistent-exception-hierarchy]] === Consistent Exception Hierarchy @@ -53,7 +49,6 @@ own exception hierarchy with the `XmlMappingException` as the root exception. These runtime exceptions wrap the original exception so that no information is lost. - [[oxm-marshaller-unmarshaller]] == `Marshaller` and `Unmarshaller` @@ -61,7 +56,6 @@ As stated in the xref:data-access/oxm.adoc#oxm-introduction[introduction], a mar to XML, and an unmarshaller deserializes XML stream to an object. This section describes the two Spring interfaces used for this purpose. - [[oxm-marshaller]] === Understanding `Marshaller` @@ -104,7 +98,6 @@ must be mapped in a mapping file, be marked with an annotation, be registered wi marshaller, or have a common base class. Refer to the later sections in this chapter to determine how your O-X technology manages this. - [[oxm-unmarshaller]] === Understanding `Unmarshaller` @@ -146,7 +139,6 @@ Even though there are two separate marshalling interfaces (`Marshaller` and This means that you can wire up one marshaller class and refer to it both as a marshaller and as an unmarshaller in your `applicationContext.xml`. - [[oxm-xmlmappingexception]] === Understanding `XmlMappingException` @@ -163,7 +155,6 @@ The O-X Mapping exception hierarchy is shown in the following figure: image::oxm-exceptions.png[] - [[oxm-usage]] == Using `Marshaller` and `Unmarshaller` @@ -319,7 +310,6 @@ This sample application produces the following `settings.xml` file: ---- - [[oxm-schema-based-config]] == XML Configuration Namespace @@ -356,7 +346,6 @@ the configuration of a JAXB2 marshaller might resemble the following: ---- - [[oxm-jaxb]] == JAXB @@ -369,7 +358,6 @@ Spring supports the JAXB 2.0 API as XML marshalling strategies, following the The corresponding integration classes reside in the `org.springframework.oxm.jaxb` package. - [[oxm-jaxb2]] === Using `Jaxb2Marshaller` @@ -436,7 +424,6 @@ The following table describes the available attributes: |=== - [[oxm-jibx]] == JiBX @@ -450,7 +437,6 @@ For more information on JiBX, see the http://jibx.sourceforge.net/[JiBX web site]. The Spring integration classes reside in the `org.springframework.oxm.jibx` package. - [[oxm-jibx-marshaller]] === Using `JibxMarshaller` @@ -503,7 +489,6 @@ The following table describes the available attributes: |=== - [[oxm-xstream]] == XStream @@ -514,7 +499,6 @@ For more information on XStream, see the https://x-stream.github.io/[XStream web site]. The Spring integration classes reside in the `org.springframework.oxm.xstream` package. - [[oxm-xstream-marshaller]] === Using `XStreamMarshaller` @@ -557,16 +541,14 @@ set the `supportedClasses` property on the `XStreamMarshaller`, as the following Doing so ensures that only the registered classes are eligible for unmarshalling. Additionally, you can register -{spring-framework-api}/oxm/xstream/XStreamMarshaller.html#setConverters(com.thoughtworks.xstream.converters.ConverterMatcher...)[custom -converters] to make sure that only your supported classes can be unmarshalled. You might -want to add a `CatchAllConverter` as the last converter in the list, in addition to -converters that explicitly support the domain classes that should be supported. As a -result, default XStream converters with lower priorities and possible security +{spring-framework-api}/oxm/xstream/XStreamMarshaller.html#setConverters(com.thoughtworks.xstream.converters.ConverterMatcher...)[custom converters] +to make sure that only your supported classes can be unmarshalled. You might want +to add a `CatchAllConverter` as the last converter in the list, in addition to +converters that explicitly support the domain classes that should be supported. +As a result, default XStream converters with lower priorities and possible security vulnerabilities do not get invoked. ===== NOTE: Note that XStream is an XML serialization library, not a data binding library. Therefore, it has limited namespace support. As a result, it is rather unsuitable for usage within Web Services. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/r2dbc.adoc b/framework-docs/modules/ROOT/pages/data-access/r2dbc.adoc index 086562d73bd..4b08f473ee1 100644 --- a/framework-docs/modules/ROOT/pages/data-access/r2dbc.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/r2dbc.adoc @@ -33,7 +33,6 @@ including error handling. It includes the following topics: * xref:data-access/r2dbc.adoc#r2dbc-DatabaseClient-filter[Statement Filters] * xref:data-access/r2dbc.adoc#r2dbc-auto-generated-keys[Retrieving Auto-generated Keys] - [[r2dbc-DatabaseClient]] === Using `DatabaseClient` @@ -639,6 +638,7 @@ databases, you may want multiple `DatabaseClient` instances, which requires mult `ConnectionFactory` and, subsequently, multiple differently configured `DatabaseClient` instances. + [[r2dbc-auto-generated-keys]] == Retrieving Auto-generated Keys @@ -686,7 +686,6 @@ This section covers: * xref:data-access/r2dbc.adoc#r2dbc-TransactionAwareConnectionFactoryProxy[Using `TransactionAwareConnectionFactoryProxy`] * xref:data-access/r2dbc.adoc#r2dbc-R2dbcTransactionManager[Using `R2dbcTransactionManager`] - [[r2dbc-ConnectionFactory]] === Using `ConnectionFactory` @@ -729,7 +728,6 @@ Kotlin:: ---- ====== - [[r2dbc-ConnectionFactoryUtils]] === Using `ConnectionFactoryUtils` @@ -740,7 +738,6 @@ and close connections (if necessary). It supports subscriber ``Context``-bound connections with, for example `R2dbcTransactionManager`. - [[r2dbc-SingleConnectionFactory]] === Using `SingleConnectionFactory` @@ -757,7 +754,6 @@ such as pipelining if your R2DBC driver permits for such use. In contrast to a pooled `ConnectionFactory`, it reuses the same connection all the time, avoiding excessive creation of physical connections. - [[r2dbc-TransactionAwareConnectionFactoryProxy]] === Using `TransactionAwareConnectionFactoryProxy` @@ -773,7 +769,6 @@ for resource management. See the {spring-framework-api}/r2dbc/connection/TransactionAwareConnectionFactoryProxy.html[`TransactionAwareConnectionFactoryProxy`] javadoc for more details. - [[r2dbc-R2dbcTransactionManager]] === Using `R2dbcTransactionManager` @@ -787,6 +782,3 @@ Application code is required to retrieve the R2DBC `Connection` through `ConnectionFactory.create()`. All framework classes (such as `DatabaseClient`) use this strategy implicitly. If not used with a transaction manager, the lookup strategy behaves exactly like `ConnectionFactory.create()` and can therefore be used in any case. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction.adoc index e21a2cd7acf..3c6a6aec23e 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction.adoc @@ -32,6 +32,3 @@ The following sections describe the Spring Framework's transaction features and The chapter also includes discussions of best practices, xref:data-access/transaction/application-server-integration.adoc[application server integration], and xref:data-access/transaction/solutions-to-common-problems.adoc[solutions to common problems]. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/application-server-integration.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/application-server-integration.adoc index 4e865292cdd..8eec2397fd6 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/application-server-integration.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/application-server-integration.adoc @@ -14,6 +14,3 @@ Spring's `JtaTransactionManager` is the standard choice to run on Jakarta EE app servers and is known to work on all common servers. Advanced functionality, such as transaction suspension, works on many servers as well (including GlassFish, JBoss and Geronimo) without any special configuration required. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative.adoc index a87442d8916..ef690da3ef6 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative.adoc @@ -49,5 +49,3 @@ transaction automatically on an application exception (that is, a checked except other than `java.rmi.RemoteException`). While the Spring default behavior for declarative transaction management follows EJB convention (roll back is automatic only on unchecked exceptions), it is often useful to customize this behavior. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/annotations.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/annotations.adoc index f6e75c09c35..78ea7c8b328 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/annotations.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/annotations.adoc @@ -364,6 +364,7 @@ Kotlin:: ---- ====== + [[transaction-declarative-attransactional-settings]] == `@Transactional` Settings @@ -469,6 +470,7 @@ name of the transactionally advised class + `.` + the method name. For example, `handlePayment(..)` method of the `BusinessService` class started a transaction, the name of the transaction would be `com.example.BusinessService.handlePayment`. + [[tx-multiple-tx-mgrs-with-attransactional]] == Multiple Transaction Managers with `@Transactional` @@ -571,6 +573,7 @@ definitions declare the same qualifier value. Such a qualifier value only needs to be unique within a set of type-matching beans, not having to serve as an ID. ==== + [[tx-custom-attributes]] == Custom Composed Annotations @@ -658,5 +661,3 @@ Kotlin:: In the preceding example, we used the syntax to define the transaction manager qualifier and transactional labels, but we could also have included propagation behavior, rollback rules, timeouts, and other features. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/applying-more-than-just-tx-advice.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/applying-more-than-just-tx-advice.adoc index 1a14bb5e499..59826ab473c 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/applying-more-than-just-tx-advice.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/applying-more-than-just-tx-advice.adoc @@ -218,5 +218,3 @@ aspect bean's `order` property so that it is higher than the transactional advic order value. You can configure additional aspects in similar fashion. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/aspectj.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/aspectj.adoc index b112eef4951..58b1847460b 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/aspectj.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/aspectj.adoc @@ -9,12 +9,14 @@ and then link (weave) your application with the `spring-aspects.jar` file. You must also configure the aspect with a transaction manager. You can use the Spring Framework's IoC container to take care of dependency-injecting the aspect. The simplest way to configure the transaction -management aspect is to use the `` element and specify the `mode` -attribute to `aspectj` as described in xref:data-access/transaction/declarative/annotations.adoc[Using `@Transactional`]. Because -we focus here on applications that run outside of a Spring container, we show -you how to do it programmatically. +management aspect is to use the `` element and specify the +`mode` attribute to `aspectj` as described in +xref:data-access/transaction/declarative/annotations.adoc[Using `@Transactional`]. +Because we focus here on applications that run outside of a Spring container, +we show you how to do it programmatically. -NOTE: Prior to continuing, you may want to read xref:data-access/transaction/declarative/annotations.adoc[Using `@Transactional`] and +NOTE: Prior to continuing, you may want to read +xref:data-access/transaction/declarative/annotations.adoc[Using `@Transactional`] and xref:core/aop.adoc[AOP] respectively. The following example shows how to create a transaction manager and configure the @@ -58,8 +60,6 @@ regardless of visibility. To weave your applications with the `AnnotationTransactionAspect`, you must either build your application with AspectJ (see the {aspectj-docs-devguide}/index.html[AspectJ Development -Guide]) or use load-time weaving. See xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time weaving with AspectJ in the Spring Framework] - for a discussion of load-time weaving with AspectJ. - - - +Guide]) or use load-time weaving. See +xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time weaving with AspectJ in the Spring Framework] +for a discussion of load-time weaving with AspectJ. diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/diff-tx.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/diff-tx.adoc index 4881f06f5c9..7a1eb90b74d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/diff-tx.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/diff-tx.adoc @@ -110,5 +110,3 @@ transactional settings: ---- - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/first-example.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/first-example.adoc index 692de56d9e1..633b8169c01 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/first-example.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/first-example.adoc @@ -425,5 +425,3 @@ computation sequence along with a promise to begin and complete the computation. A `Publisher` can emit data while a transaction is ongoing but not necessarily completed. Therefore, methods that depend upon successful completion of an entire transaction need to ensure completion and buffer results in the calling code. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/rolling-back.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/rolling-back.adoc index c261821fa23..a16f4985f2d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/rolling-back.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/rolling-back.adoc @@ -81,8 +81,8 @@ thrown, and the rules are based on exception types or exception patterns. Rollback rules may be configured in XML via the `rollback-for` and `no-rollback-for` attributes, which allow rules to be defined as patterns. When using -xref:data-access/transaction/declarative/annotations.adoc#transaction-declarative-attransactional-settings[`@Transactional`], rollback rules may -be configured via the `rollbackFor`/`noRollbackFor` and +xref:data-access/transaction/declarative/annotations.adoc#transaction-declarative-attransactional-settings[`@Transactional`], +rollback rules may be configured via the `rollbackFor`/`noRollbackFor` and `rollbackForClassName`/`noRollbackForClassName` attributes, which allow rules to be defined based on exception types or patterns, respectively. @@ -202,5 +202,3 @@ Kotlin:: You are strongly encouraged to use the declarative approach to rollback, if at all possible. Programmatic rollback is available should you absolutely need it, but its usage flies in the face of achieving a clean POJO-based architecture. - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-decl-explained.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-decl-explained.adoc index afece4181a3..eb71fd52e9d 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-decl-explained.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-decl-explained.adoc @@ -48,5 +48,3 @@ to be associated with a regular `PlatformTransactionManager`, for example, throu The following image shows a conceptual view of calling a method on a transactional proxy: image::tx.png[] - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-propagation.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-propagation.adoc index b41fd48f0d5..bafcad829ac 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-propagation.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/tx-propagation.adoc @@ -8,6 +8,7 @@ details some of the semantics regarding transaction propagation in Spring. In Spring-managed transactions, be aware of the difference between physical and logical transactions, and how the propagation setting applies to this difference. + [[tx-propagation-required]] == Understanding `PROPAGATION_REQUIRED` @@ -45,6 +46,7 @@ is not aware) silently marks a transaction as rollback-only, the outer caller st calls commit. The outer caller needs to receive an `UnexpectedRollbackException` to indicate clearly that a rollback was performed instead. + [[tx-propagation-requires_new]] == Understanding `PROPAGATION_REQUIRES_NEW` @@ -67,6 +69,7 @@ for their inner transaction, with the pool not being able to hand out any such i connection anymore. Do not use `PROPAGATION_REQUIRES_NEW` unless your connection pool is appropriately sized, exceeding the number of concurrent threads by at least 1. + [[tx-propagation-nested]] == Understanding `PROPAGATION_NESTED` @@ -75,6 +78,5 @@ that it can roll back to. Such partial rollbacks let an inner transaction scope trigger a rollback for its scope, with the outer transaction being able to continue the physical transaction despite some operations having been rolled back. This setting is typically mapped onto JDBC savepoints, so it works only with JDBC resource -transactions. See Spring's {spring-framework-api}/jdbc/datasource/DataSourceTransactionManager.html[`DataSourceTransactionManager`]. - - +transactions. See Spring's +{spring-framework-api}/jdbc/datasource/DataSourceTransactionManager.html[`DataSourceTransactionManager`]. diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/txadvice-settings.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/txadvice-settings.adoc index 566f44d1f65..30f0e3f789f 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/txadvice-settings.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/declarative/txadvice-settings.adoc @@ -59,5 +59,3 @@ that are nested within `` and `` tags: | Comma-delimited list of `Exception` instances that do not trigger rollback. For example, `com.foo.MyBusinessException,ServletException`. |=== - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/event.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/event.adoc index 8ee00835b25..972a6004af3 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/event.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/event.adoc @@ -66,6 +66,3 @@ See the {spring-framework-api}/transaction/reactive/TransactionalEventPublisher.html[`TransactionalEventPublisher`] javadoc for details. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/motivation.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/motivation.adoc index 60bf567d9c4..1cc0ab1aac3 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/motivation.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/motivation.adoc @@ -85,6 +85,3 @@ and face a hefty rework if you need that code to run within global, container-ma transactions. With the Spring Framework, only some of the bean definitions in your configuration file need to change (rather than your code). **** - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/programmatic.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/programmatic.adoc index 1c14f7893a5..0b22fe99a22 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/programmatic.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/programmatic.adoc @@ -220,6 +220,7 @@ of a `TransactionTemplate`, if a class needs to use a `TransactionTemplate` with different settings (for example, a different isolation level), you need to create two distinct `TransactionTemplate` instances. + [[tx-prog-operator]] == Using the `TransactionalOperator` @@ -331,7 +332,6 @@ As a result it is important to consider the operators used downstream from a tra `Publisher`. In particular in the case of a `Flux` or other multi-value `Publisher`, the full output must be consumed to allow the transaction to complete. - [[tx-prog-operator-settings]] === Specifying Transaction Settings @@ -382,6 +382,7 @@ Kotlin:: ---- ====== + [[transaction-programmatic-tm]] == Using the `TransactionManager` @@ -440,7 +441,6 @@ Kotlin:: ---- ====== - [[transaction-programmatic-rtm]] === Using the `ReactiveTransactionManager` @@ -492,5 +492,3 @@ Kotlin:: } ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/resources.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/resources.adoc index a8697e77094..033178e104a 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/resources.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/resources.adoc @@ -12,7 +12,3 @@ For more information about the Spring Framework's transaction support, see: available from https://www.infoq.com/[InfoQ] that provides a well-paced introduction to transactions in Java. It also includes side-by-side examples of how to configure and use transactions with both the Spring Framework and EJB3. - - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/solutions-to-common-problems.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/solutions-to-common-problems.adoc index 669760b534f..f9d7503f70e 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/solutions-to-common-problems.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/solutions-to-common-problems.adoc @@ -18,6 +18,3 @@ it) for all your transactional operations. Otherwise, the transaction infrastruc tries to perform local transactions on such resources as container `DataSource` instances. Such local transactions do not make sense, and a good application server treats them as errors. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/strategies.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/strategies.adoc index d052af9dd6e..b0f70a569b7 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/strategies.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/strategies.adoc @@ -279,6 +279,3 @@ for enforcing the same defaults: ---- - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/tx-decl-vs-prog.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/tx-decl-vs-prog.adoc index ece5dd419cf..ec5704aabc0 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/tx-decl-vs-prog.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/tx-decl-vs-prog.adoc @@ -15,6 +15,3 @@ declarative transaction management is usually worthwhile. It keeps transaction management out of business logic and is not difficult to configure. When using the Spring Framework, rather than EJB CMT, the configuration cost of declarative transaction management is greatly reduced. - - - diff --git a/framework-docs/modules/ROOT/pages/data-access/transaction/tx-resource-synchronization.adoc b/framework-docs/modules/ROOT/pages/data-access/transaction/tx-resource-synchronization.adoc index c3eae7a6110..a6aae73aaa1 100644 --- a/framework-docs/modules/ROOT/pages/data-access/transaction/tx-resource-synchronization.adoc +++ b/framework-docs/modules/ROOT/pages/data-access/transaction/tx-resource-synchronization.adoc @@ -78,6 +78,3 @@ code must be called and passed a standard JDBC `DataSource` interface implementa that case, it is possible that this code is usable but is participating in Spring-managed transactions. You can write your new code by using the higher-level abstractions mentioned earlier. - - - diff --git a/framework-docs/modules/ROOT/pages/integration.adoc b/framework-docs/modules/ROOT/pages/integration.adoc index 4ab4774f755..e6c70f54765 100644 --- a/framework-docs/modules/ROOT/pages/integration.adoc +++ b/framework-docs/modules/ROOT/pages/integration.adoc @@ -4,11 +4,3 @@ This part of the reference documentation covers Spring Framework's integration with a number of technologies. - - - - - - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache.adoc b/framework-docs/modules/ROOT/pages/integration/cache.adoc index 2f763a709d3..d215dcafa08 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache.adoc @@ -9,6 +9,3 @@ minimal impact on the code. In Spring Framework 4.1, the cache abstraction was significantly extended with support for xref:integration/cache/jsr-107.adoc[JSR-107 annotations] and more customization options. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/annotations.adoc b/framework-docs/modules/ROOT/pages/integration/cache/annotations.adoc index 61ecce6957e..2d1b2e0d29a 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/annotations.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/annotations.adoc @@ -649,11 +649,11 @@ triggers cache population or eviction. This is quite handy as a template mechani as it eliminates the need to duplicate cache annotation declarations, which is especially useful if the key or condition are specified or if the foreign imports (`org.springframework`) are not allowed in your code base. Similarly to the rest -of the xref:core/beans/classpath-scanning.adoc#beans-stereotype-annotations[stereotype] annotations, you can -use `@Cacheable`, `@CachePut`, `@CacheEvict`, and `@CacheConfig` as -xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotations] (that is, annotations that -can annotate other annotations). In the following example, we replace a common -`@Cacheable` declaration with our own custom annotation: +of the xref:core/beans/classpath-scanning.adoc#beans-stereotype-annotations[stereotype] +annotations, you can use `@Cacheable`, `@CachePut`, `@CacheEvict`, and `@CacheConfig` +as xref:core/beans/classpath-scanning.adoc#beans-meta-annotations[meta-annotations] +(that is, annotations that can annotate other annotations). In the following example, +we replace a common `@Cacheable` declaration with our own custom annotation: [source,java,indent=0,subs="verbatim,quotes"] ---- @@ -684,7 +684,5 @@ preceding code: Even though `@SlowService` is not a Spring annotation, the container automatically picks up its declaration at runtime and understands its meaning. Note that, as mentioned -xref:integration/cache/annotations.adoc#cache-annotation-enable[earlier], annotation-driven behavior needs to be enabled. - - - +xref:integration/cache/annotations.adoc#cache-annotation-enable[earlier], +annotation-driven behavior needs to be enabled. diff --git a/framework-docs/modules/ROOT/pages/integration/cache/declarative-xml.adoc b/framework-docs/modules/ROOT/pages/integration/cache/declarative-xml.adoc index 7b28afd7467..82bf1b932ba 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/declarative-xml.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/declarative-xml.adoc @@ -51,6 +51,3 @@ However, through XML, it is easier to apply package or group or interface-wide c (again, due to the AspectJ pointcut) and to create template-like definitions (as we did in the preceding example by defining the target cache through the `cache:definitions` `cache` attribute). - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/jsr-107.adoc b/framework-docs/modules/ROOT/pages/integration/cache/jsr-107.adoc index 1bf06494097..f771a379cb0 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/jsr-107.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/jsr-107.adoc @@ -118,6 +118,3 @@ NOTE: Depending on your use case, the choice is basically yours. You can even mi match services by using the JSR-107 API on some and using Spring's own annotations on others. However, if these services impact the same caches, you should use a consistent and identical key generation implementation. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/plug.adoc b/framework-docs/modules/ROOT/pages/integration/cache/plug.adoc index 56e3aa482ca..5f9f9619cd9 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/plug.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/plug.adoc @@ -10,6 +10,3 @@ caching abstraction framework on top of the storage API, as the _Caffeine_ class Most `CacheManager` classes can use the classes in the `org.springframework.cache.support` package (such as `AbstractCacheManager` which takes care of the boiler-plate code, leaving only the actual mapping to be completed). - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/specific-config.adoc b/framework-docs/modules/ROOT/pages/integration/cache/specific-config.adoc index c05c6bda3bd..1dce814b029 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/specific-config.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/specific-config.adoc @@ -8,4 +8,3 @@ policies and different topologies that other solutions do not support (for examp the JDK `ConcurrentHashMap` -- exposing that in the cache abstraction would be useless because there would no backing support). Such functionality should be controlled directly through the backing cache (when configuring it) or through its native API. - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/store-configuration.adoc b/framework-docs/modules/ROOT/pages/integration/cache/store-configuration.adoc index ed350b2385e..0b79a14a73b 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/store-configuration.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/store-configuration.adoc @@ -94,6 +94,3 @@ handled by the configured cache managers. That is, every cache definition not fo either `jdkCache` or `gemfireCache` (configured earlier in the example) is handled by the no-op cache, which does not store any information, causing the target method to be invoked every time. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cache/strategies.adoc b/framework-docs/modules/ROOT/pages/integration/cache/strategies.adoc index 4235f061745..2b771dd238b 100644 --- a/framework-docs/modules/ROOT/pages/integration/cache/strategies.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cache/strategies.adoc @@ -45,11 +45,11 @@ that is, the abstraction frees you from having to write the caching logic but do provide the actual data store. This abstraction is materialized by the `org.springframework.cache.Cache` and `org.springframework.cache.CacheManager` interfaces. -Spring provides xref:integration/cache/store-configuration.adoc[a few implementations] of that abstraction: -JDK `java.util.concurrent.ConcurrentMap` based caches, Gemfire cache, +Spring provides xref:integration/cache/store-configuration.adoc[a few implementations] +of that abstraction: JDK `java.util.concurrent.ConcurrentMap` based caches, Gemfire cache, https://github.com/ben-manes/caffeine/wiki[Caffeine], and JSR-107 compliant caches (such -as Ehcache 3.x). See xref:integration/cache/plug.adoc[Plugging-in Different Back-end Caches] for more information on plugging in other cache -stores and providers. +as Ehcache 3.x). See xref:integration/cache/plug.adoc[Plugging-in Different Back-end Caches] +for more information on plugging in other cache stores and providers. IMPORTANT: The caching abstraction has no special handling for multi-threaded and multi-process environments, as such features are handled by the cache implementation. @@ -71,6 +71,3 @@ To use the cache abstraction, you need to take care of two aspects: * Caching declaration: Identify the methods that need to be cached and their policies. * Cache configuration: The backing cache where the data is stored and from which it is read. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/cds.adoc b/framework-docs/modules/ROOT/pages/integration/cds.adoc index c660a4c650f..4f8c0aa0ba6 100644 --- a/framework-docs/modules/ROOT/pages/integration/cds.adoc +++ b/framework-docs/modules/ROOT/pages/integration/cds.adoc @@ -9,6 +9,7 @@ To use this feature, a CDS archive should be created for the particular classpat application. The Spring Framework provides a hook-point to ease the creation of the archive. Once the archive is available, users should opt in to use it via a JVM flag. + == Creating the CDS Archive A CDS archive for an application can be created when the application exits. The Spring @@ -40,6 +41,7 @@ command: $ java -Xshare:dump ---- + == Using the Archive Once the archive is available, add `-XX:SharedArchiveFile=application.jsa` to your startup diff --git a/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc b/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc index 934b95b1dc8..19eb3b474b6 100644 --- a/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc +++ b/framework-docs/modules/ROOT/pages/integration/checkpoint-restore.adoc @@ -13,6 +13,7 @@ WARNING: The files generated in the path specified by `-XX:CRaCCheckpointTo=PATH Conceptually, checkpoint and restore align with the xref:core/beans/factory-nature.adoc#beans-factory-lifecycle-processor[Spring `Lifecycle` contract] for individual beans. + == On-demand checkpoint/restore of a running application A checkpoint can be created on demand, for example using a command like `jcmd application.jar JDK.checkpoint`. Before the creation of the checkpoint, Spring stops all the running beans, giving them a chance to close resources if needed by implementing `Lifecycle.stop`. After restore, the same beans are restarted, with `Lifecycle.start` allowing beans to reopen resources when relevant. For libraries that do not depend on Spring, custom checkpoint/restore integration can be provided by implementing `org.crac.Resource` and registering the related instance. @@ -23,6 +24,7 @@ WARNING: Be aware that when defining scheduling tasks at a fixed rate, for examp NOTE: If the checkpoint is created on a warmed-up JVM, the restored JVM will be equally warmed-up, allowing potentially peak performance immediately. This method typically requires access to remote services, and thus requires some level of platform integration. + == Automatic checkpoint/restore at startup When the `-Dspring.context.checkpoint=onRefresh` JVM system property is set, a checkpoint is created automatically at diff --git a/framework-docs/modules/ROOT/pages/integration/email.adoc b/framework-docs/modules/ROOT/pages/integration/email.adoc index 46493a7de9a..8eaf2145570 100644 --- a/framework-docs/modules/ROOT/pages/integration/email.adoc +++ b/framework-docs/modules/ROOT/pages/integration/email.adoc @@ -234,4 +234,3 @@ tasked only with creating the data that is to be rendered in the email template sending the email. It is definitely a best practice when the content of your email messages becomes even moderately complex, and, with the Spring Framework's support classes for FreeMarker, it becomes quite easy to do. - diff --git a/framework-docs/modules/ROOT/pages/integration/jms.adoc b/framework-docs/modules/ROOT/pages/integration/jms.adoc index d3ca79413b4..ba4fba9b317 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms.adoc @@ -46,19 +46,3 @@ the `ConnectionFactory` suitable for use in standalone applications. It also con implementation of Spring's `PlatformTransactionManager` for JMS (the cunningly named `JmsTransactionManager`). This allows for seamless integration of JMS as a transactional resource into Spring's transaction management mechanisms. - -[NOTE] -==== -As of Spring Framework 5, Spring's JMS package fully supports JMS 2.0 and requires the -JMS 2.0 API to be present at runtime. We recommend the use of a JMS 2.0 compatible provider. - -If you happen to use an older message broker in your system, you may try upgrading to a -JMS 2.0 compatible driver for your existing broker generation. Alternatively, you may also -try to run against a JMS 1.1 based driver, simply putting the JMS 2.0 API jar on the -classpath but only using JMS 1.1 compatible API against your driver. Spring's JMS support -adheres to JMS 1.1 conventions by default, so with corresponding configuration it does -support such a scenario. However, please consider this for transition scenarios only. -==== - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jms/annotated.adoc b/framework-docs/modules/ROOT/pages/integration/jms/annotated.adoc index 586538b4919..b9d86efd9e0 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/annotated.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/annotated.adoc @@ -243,6 +243,3 @@ as the following example shows: } } ---- - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jms/jca-message-endpoint-manager.adoc b/framework-docs/modules/ROOT/pages/integration/jms/jca-message-endpoint-manager.adoc index 8838f449d70..d88cd8581a4 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/jca-message-endpoint-manager.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/jca-message-endpoint-manager.adoc @@ -33,6 +33,3 @@ It uses the same underlying resource provider contract. As with EJB 2.1 MDBs, yo message listener interface supported by your JCA provider in the Spring context as well. Spring nevertheless provides explicit "`convenience`" support for JMS, because JMS is the most common endpoint API used with the JCA endpoint management contract. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jms/namespace.adoc b/framework-docs/modules/ROOT/pages/integration/jms/namespace.adoc index 8ecda386a37..ced2a42c283 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/namespace.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/namespace.adoc @@ -22,7 +22,6 @@ namespace elements, you need to reference the JMS schema, as the following examp ---- <1> Referencing the JMS schema. - The namespace consists of three top-level elements: ``, `` and ``. `` enables the use of xref:integration/jms/annotated.adoc[annotation-driven listener endpoints] . `` and `` diff --git a/framework-docs/modules/ROOT/pages/integration/jms/receiving.adoc b/framework-docs/modules/ROOT/pages/integration/jms/receiving.adoc index ddd9c43d2e8..b4caffb590f 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/receiving.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/receiving.adoc @@ -25,9 +25,10 @@ See xref:integration/jms/annotated.adoc#jms-annotated-support[Enable Listener En In a fashion similar to a Message-Driven Bean (MDB) in the EJB world, the Message-Driven POJO (MDP) acts as a receiver for JMS messages. The one restriction (but see -xref:integration/jms/receiving.adoc#jms-receiving-async-message-listener-adapter[Using `MessageListenerAdapter`]) on an MDP is that it must implement -the `jakarta.jms.MessageListener` interface. Note that, if your POJO receives messages -on multiple threads, it is important to ensure that your implementation is thread-safe. +xref:integration/jms/receiving.adoc#jms-receiving-async-message-listener-adapter[Using `MessageListenerAdapter`]) +on an MDP is that it must implement the `jakarta.jms.MessageListener` interface. +Note that, if your POJO receives messages on multiple threads, it is important to +ensure that your implementation is thread-safe. The following example shows a simple implementation of an MDP: diff --git a/framework-docs/modules/ROOT/pages/integration/jms/sending.adoc b/framework-docs/modules/ROOT/pages/integration/jms/sending.adoc index a5f479b0ea6..502e87e4190 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/sending.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/sending.adoc @@ -59,8 +59,8 @@ If you created the `JmsTemplate` and specified a default destination, the `send(MessageCreator c)` sends a message to that destination. -[[jms-msg-conversion]] -== Using Message Converters +[[jms-sending-conversion]] +== Using JMS Message Converters To facilitate the sending of domain model objects, the `JmsTemplate` has various send methods that take a Java object as an argument for a message's data @@ -87,7 +87,7 @@ following example shows how to modify a message header and a property after a [source,java,indent=0,subs="verbatim,quotes"] ---- public void sendWithConversion() { - Map map = new HashMap(); + Map map = new HashMap<>(); map.put("Name", "Mark"); map.put("Age", new Integer(47)); jmsTemplate.convertAndSend("testQueue", map, new MessagePostProcessor() { @@ -121,14 +121,11 @@ MapMessage={ ---- -[[jms-callbacks]] -== Using `SessionCallback` and `ProducerCallback` +[[jms-sending-callbacks]] +== Using `SessionCallback` and `ProducerCallback` on `JmsTemplate` While the send operations cover many common usage scenarios, you might sometimes want to perform multiple operations on a JMS `Session` or `MessageProducer`. The `SessionCallback` and `ProducerCallback` expose the JMS `Session` and `Session` / `MessageProducer` pair, respectively. The `execute()` methods on `JmsTemplate` run these callback methods. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jms/using.adoc b/framework-docs/modules/ROOT/pages/integration/jms/using.adoc index 01babeefac6..ccf7145b146 100644 --- a/framework-docs/modules/ROOT/pages/integration/jms/using.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jms/using.adoc @@ -293,6 +293,3 @@ in an unmanaged environment, you can specify these values through the use of the properties `sessionTransacted` and `sessionAcknowledgeMode`. When you use a `PlatformTransactionManager` with `JmsTemplate`, the template is always given a transactional JMS `Session`. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx.adoc b/framework-docs/modules/ROOT/pages/integration/jmx.adoc index 40e2bcd0096..ebc04a0c19b 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx.adoc @@ -21,6 +21,3 @@ These features are designed to work without coupling your application components either Spring or JMX interfaces and classes. Indeed, for the most part, your application classes need not be aware of either Spring or JMX in order to take advantage of the Spring JMX features. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/exporting.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/exporting.adoc index 138c867a20c..4a32631fb64 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/exporting.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/exporting.adoc @@ -231,6 +231,3 @@ behavior to the `REPLACE_EXISTING` behavior: ---- - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/interface.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/interface.adoc index 68e1c25206b..82391e2c478 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/interface.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/interface.adoc @@ -425,6 +425,3 @@ appropriate half of a JMX attribute. In the preceding code, the method mappings beans that are exposed to JMX. To control method exposure on a bean-by-bean basis, you can use the `methodMappings` property of `MethodNameMBeanInfoAssembler` to map bean names to lists of method names. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/jsr160.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/jsr160.adoc index 7d9ce296d2b..90a1a8e3ab9 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/jsr160.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/jsr160.adoc @@ -98,6 +98,3 @@ as the following example shows: In the preceding example, we used MX4J 3.0.0. See the official MX4J documentation for more information. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/naming.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/naming.adoc index cdaf8043223..1d5374183a0 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/naming.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/naming.adoc @@ -141,6 +141,3 @@ also hides the JMX-managed resource annotations. Hence, you should use target-cl case (through setting the 'proxy-target-class' flag on ``, `` and so on). Otherwise, your JMX beans might be silently ignored at startup. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/notifications.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/notifications.adoc index 4811434a9c7..43c7371671f 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/notifications.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/notifications.adoc @@ -303,6 +303,3 @@ the nicer features of Spring's JMX support. It does, however, come with the pric coupling your classes to both Spring and JMX. As always, the advice here is to be pragmatic. If you need the functionality offered by the `NotificationPublisher` and you can accept the coupling to both Spring and JMX, then do so. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/proxy.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/proxy.adoc index 317d9409689..ecaedbedaaa 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/proxy.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/proxy.adoc @@ -44,6 +44,3 @@ that uses the `MBeanServerConnectionFactoryBean`. This `MBeanServerConnection` i passed to the `MBeanProxyFactoryBean` through the `server` property. The proxy that is created forwards all invocations to the `MBeanServer` through this `MBeanServerConnection`. - - - diff --git a/framework-docs/modules/ROOT/pages/integration/jmx/resources.adoc b/framework-docs/modules/ROOT/pages/integration/jmx/resources.adoc index 7e6164bc86e..4cda87043e8 100644 --- a/framework-docs/modules/ROOT/pages/integration/jmx/resources.adoc +++ b/framework-docs/modules/ROOT/pages/integration/jmx/resources.adoc @@ -10,4 +10,3 @@ homepage] at Oracle. * The {JSR}160[JMX Remote API specification] (JSR-000160). * The http://mx4j.sourceforge.net/[MX4J homepage]. (MX4J is an open-source implementation of various JMX specs.) - diff --git a/framework-docs/modules/ROOT/pages/integration/observability.adoc b/framework-docs/modules/ROOT/pages/integration/observability.adoc index 54cfa9e03bb..c9129ef1e54 100644 --- a/framework-docs/modules/ROOT/pages/integration/observability.adoc +++ b/framework-docs/modules/ROOT/pages/integration/observability.adoc @@ -88,6 +88,7 @@ include-code::./ServerRequestObservationFilter[] You can configure `ObservationFilter` instances on the `ObservationRegistry`. + [[observability.tasks-scheduled]] == @Scheduled tasks instrumentation @@ -184,6 +185,7 @@ Such listeners are set on a `MessageConsumer` within a session callback (see `Jm This observation uses the `io.micrometer.jakarta9.instrument.jms.DefaultJmsProcessObservationConvention` by default, backed by the `io.micrometer.jakarta9.instrument.jms.JmsProcessObservationContext`. + [[observability.http-server]] == HTTP Server instrumentation @@ -226,7 +228,6 @@ By default, the following `KeyValues` are created: |`http.url` _(required)_|HTTP request URI. |=== - [[observability.http-server.reactive]] === Reactive applications @@ -265,7 +266,6 @@ By default, the following `KeyValues` are created: |=== - [[observability.http-client]] == HTTP Client Instrumentation @@ -301,7 +301,6 @@ Instrumentation uses the `org.springframework.http.client.observation.ClientRequ |`http.url` _(required)_|HTTP request URI. |=== - [[observability.http-client.restclient]] === RestClient @@ -329,7 +328,6 @@ Instrumentation uses the `org.springframework.http.client.observation.ClientRequ |`http.url` _(required)_|HTTP request URI. |=== - [[observability.http-client.webclient]] === WebClient diff --git a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc index 0f23a35d0e6..2ae8a9c9cc6 100644 --- a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc +++ b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc @@ -368,7 +368,6 @@ Kotlin:: <3> Convert the response into a Pet domain object ====== - [[rest-message-conversion]] === HTTP Message Conversion @@ -441,6 +440,7 @@ Finally, it will resort to the simple default. TIP: Note that the `SimpleClientHttpRequestFactory` may raise an exception when accessing the status of a response that represents an error (for example, 401). If this is an issue, use any of the alternative request factories. + [[rest-webclient]] == `WebClient` @@ -460,8 +460,6 @@ synchronous, asynchronous, and streaming scenarios. See xref:web/webflux-webclient.adoc[WebClient] for more details. - - [[rest-resttemplate]] == `RestTemplate` @@ -533,7 +531,8 @@ See the xref:integration/observability.adoc#http-client.resttemplate[RestTemplat [[rest-template-body]] === Body -Objects passed into and returned from `RestTemplate` methods are converted to and from HTTP messages with the help of an `HttpMessageConverter`, see <>. +Objects passed into and returned from `RestTemplate` methods are converted to and from HTTP messages +with the help of an `HttpMessageConverter`, see <>. === Migrating from `RestTemplate` to `RestClient` @@ -919,7 +918,6 @@ For `RestTemplate`: } ---- - [[rest-http-interface-method-parameters]] === Method Parameters @@ -989,8 +987,6 @@ Method parameters cannot be `null` unless the `required` attribute (where availa parameter annotation) is set to `false`, or the parameter is marked optional as determined by {spring-framework-api}/core/MethodParameter.html#isOptional()[`MethodParameter#isOptional`]. - - [[rest-http-interface.custom-resolver]] === Custom argument resolver @@ -1084,7 +1080,6 @@ depends on how the underlying HTTP client is configured. You can set a `blockTim value on the adapter level as well, but we recommend relying on timeout settings of the underlying HTTP client, which operates at a lower level and provides more control. - [[rest-http-interface-exceptions]] === Error Handling @@ -1145,4 +1140,3 @@ performed through the client: For more details and options, see the Javadoc of `setErrorHandler` in `RestTemplate` and the `ResponseErrorHandler` hierarchy. - diff --git a/framework-docs/modules/ROOT/pages/integration/scheduling.adoc b/framework-docs/modules/ROOT/pages/integration/scheduling.adoc index a031ee208f8..302595651ac 100644 --- a/framework-docs/modules/ROOT/pages/integration/scheduling.adoc +++ b/framework-docs/modules/ROOT/pages/integration/scheduling.adoc @@ -1063,4 +1063,3 @@ it is therefore not recommended to specify values at both levels. For example, d an "org.quartz.jobStore.class" property if you mean to rely on a Spring-provided DataSource, or specify an `org.springframework.scheduling.quartz.LocalDataSourceJobStore` variant which is a full-fledged replacement for the standard `org.quartz.impl.jdbcjobstore.JobStoreTX`. - diff --git a/framework-docs/modules/ROOT/pages/languages.adoc b/framework-docs/modules/ROOT/pages/languages.adoc index ec451606e98..1f532ea9c1c 100644 --- a/framework-docs/modules/ROOT/pages/languages.adoc +++ b/framework-docs/modules/ROOT/pages/languages.adoc @@ -1,8 +1,3 @@ [[languages]] = Language Support :page-section-summary-toc: 1 - - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/dynamic.adoc b/framework-docs/modules/ROOT/pages/languages/dynamic.adoc index c0b5ccec7ca..7afe1d3d055 100644 --- a/framework-docs/modules/ROOT/pages/languages/dynamic.adoc +++ b/framework-docs/modules/ROOT/pages/languages/dynamic.adoc @@ -16,8 +16,6 @@ You can find fully working examples of where this dynamic language support can b immediately useful in xref:languages/dynamic.adoc#dynamic-language-scenarios[Scenarios]. - - [[dynamic-language-a-first-example]] == A First Example @@ -127,8 +125,6 @@ Hopefully, the preceding XML snippet is self-explanatory, but do not worry undul Keep reading for the in-depth detail on the whys and wherefores of the preceding configuration. - - [[dynamic-language-beans]] == Defining Beans that Are Backed by Dynamic Languages @@ -138,11 +134,10 @@ supported dynamic languages. Note that this chapter does not attempt to explain the syntax and idioms of the supported dynamic languages. For example, if you want to use Groovy to write certain of the classes in your application, we assume that you already know Groovy. If you need further details -about the dynamic languages themselves, see xref:languages/dynamic.adoc#dynamic-language-resources[Further Resources] at the end of +about the dynamic languages themselves, see +xref:languages/dynamic.adoc#dynamic-language-resources[Further Resources] at the end of this chapter. - - [[dynamic-language-beans-concepts]] === Common Concepts @@ -164,7 +159,6 @@ source files. You first want to read the rest of this chapter, though, as Spring's dynamic language support does make some (small) assumptions about the contents of your dynamic language source files. - [[dynamic-language-beans-concepts-xml-language-element]] ==== The element @@ -185,7 +179,6 @@ The exact attributes and child elements that are available for configuration dep exactly which language the bean has been defined in (the language-specific sections later in this chapter detail this). - [[dynamic-language-refreshable-beans]] ==== Refreshable Beans @@ -310,11 +303,10 @@ results in a fatal exception being propagated to the calling code. The refreshable bean behavior described earlier does not apply to dynamic language source files defined with the `` element notation (see -xref:languages/dynamic.adoc#dynamic-language-beans-inline[Inline Dynamic Language Source Files]). Additionally, it applies only to beans where -changes to the underlying source file can actually be detected (for example, by code -that checks the last modified date of a dynamic language source file that exists on the -file system). - +xref:languages/dynamic.adoc#dynamic-language-beans-inline[Inline Dynamic Language Source Files]). +Additionally, it applies only to beans where changes to the underlying source file can +actually be detected (for example, by code that checks the last modified date of a +dynamic language source file that exists on the file system). [[dynamic-language-beans-inline]] ==== Inline Dynamic Language Source Files @@ -347,9 +339,9 @@ If we put to one side the issues surrounding whether it is good practice to defi dynamic language source inside a Spring configuration file, the `` element can be useful in some scenarios. For instance, we might want to quickly add a Spring `Validator` implementation to a Spring MVC `Controller`. This is but a moment's -work using inline source. (See xref:languages/dynamic.adoc#dynamic-language-scenarios-validators[Scripted Validators] for such an -example.) - +work using inline source. (See +xref:languages/dynamic.adoc#dynamic-language-scenarios-validators[Scripted Validators] +for such an example.) [[dynamic-language-beans-ctor-injection]] ==== Understanding Constructor Injection in the Context of Dynamic-language-backed Beans @@ -402,8 +394,6 @@ In practice this limitation is not as significant as it first appears, since set injection is the injection style favored by the overwhelming majority of developers (we leave the discussion as to whether that is a good thing to another day). - - [[dynamic-language-beans-groovy]] === Groovy Beans @@ -482,7 +472,6 @@ legal in Groovy, it is (arguably) a bad practice. In the interests of a consiste approach, you should (in the opinion of the Spring team) respect the standard Java conventions of one (public) class per source file. - [[dynamic-language-beans-groovy-customizer]] ==== Customizing Groovy Objects by Using a Callback @@ -565,8 +554,6 @@ configuration for your beans at the `ConfigurableApplicationContext.setClassLoad this also leads to shared `GroovyClassLoader` usage and is therefore recommendable in case of a large number of scripted beans (avoiding an isolated `GroovyClassLoader` instance per bean). - - [[dynamic-language-beans-bsh]] === BeanShell Beans @@ -633,10 +620,8 @@ The following example shows the Spring XML that defines an "`instance`" of the a ---- -See xref:languages/dynamic.adoc#dynamic-language-scenarios[Scenarios] for some scenarios where you might want to use -BeanShell-based beans. - - +See xref:languages/dynamic.adoc#dynamic-language-scenarios[Scenarios] for some scenarios +where you might want to use BeanShell-based beans. [[dynamic-language-scenarios]] @@ -646,8 +631,6 @@ The possible scenarios where defining Spring managed beans in a scripting langua be beneficial are many and varied. This section describes two possible use cases for the dynamic language support in Spring. - - [[dynamic-language-scenarios-controllers]] === Scripted Spring MVC Controllers @@ -708,8 +691,6 @@ by using the Groovy dynamic language: ---- - - [[dynamic-language-scenarios-validators]] === Scripted Validators @@ -725,12 +706,13 @@ running application and would not require the restart of an application. NOTE: To effect the automatic "`pickup`" of any changes to dynamic-language-backed beans, you have to enable the 'refreshable beans' feature. See -xref:languages/dynamic.adoc#dynamic-language-refreshable-beans[Refreshable Beans] for a full and detailed treatment of this feature. +xref:languages/dynamic.adoc#dynamic-language-refreshable-beans[Refreshable Beans] +for a full and detailed treatment of this feature. The following example shows a Spring `org.springframework.validation.Validator` -implemented by using the Groovy dynamic language (see xref:core/validation/validator.adoc[Validation using Spring’s Validator interface] - for a discussion of the -`Validator` interface): +implemented by using the Groovy dynamic language (see +xref:core/validation/validator.adoc[Validation using Spring’s Validator interface] +for a discussion of the `Validator` interface): [source,groovy,indent=0,subs="verbatim,quotes"] ---- @@ -754,15 +736,11 @@ implemented by using the Groovy dynamic language (see xref:core/validation/valid ---- - - [[dynamic-language-final-notes]] == Additional Details This last section contains some additional details related to the dynamic language support. - - [[dynamic-language-final-notes-aop]] === AOP -- Advising Scripted Beans @@ -776,8 +754,6 @@ You are not limited to advising scripted beans. You can also write aspects thems in a supported dynamic language and use such beans to advise other Spring beans. This really would be an advanced use of the dynamic language support though. - - [[dynamic-language-final-notes-scopes]] === Scoping @@ -810,11 +786,10 @@ a xref:core/beans/factory-scopes.adoc#beans-factory-scopes-prototype[prototype]: ---- -See xref:core/beans/factory-scopes.adoc[Bean Scopes] in xref:web/webmvc-view/mvc-xslt.adoc#mvc-view-xslt-beandefs[The IoC Container] +See xref:core/beans/factory-scopes.adoc[Bean Scopes] in +xref:web/webmvc-view/mvc-xslt.adoc#mvc-view-xslt-beandefs[The IoC Container] for a full discussion of the scoping support in the Spring Framework. - - [[xsd-schemas-lang]] === The `lang` XML schema @@ -845,8 +820,6 @@ the correct schema so that the tags in the `lang` namespace are available to you ---- - - [[dynamic-language-resources]] == Further Resources diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin.adoc index 41fbd6bb4f6..bd8b3e4fc17 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin.adoc @@ -15,12 +15,9 @@ provided in Kotlin in addition to Java. The easiest way to build a Spring application with Kotlin is to leverage Spring Boot and its {spring-boot-docs-ref}/features/kotlin.html[dedicated Kotlin support]. {spring-site-guides}/tutorials/spring-boot-kotlin/[This comprehensive tutorial] -will teach you how to build Spring Boot applications with Kotlin using https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io]. +will teach you how to build Spring Boot applications with Kotlin using +https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io]. Feel free to join the #spring channel of https://slack.kotlinlang.org/[Kotlin Slack] or ask a question with `spring` and `kotlin` as tags on {stackoverflow-spring-kotlin-tags}[Stackoverflow] if you need support. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/annotations.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/annotations.adoc index 1725a5dc98f..4b8e97805f4 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/annotations.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/annotations.adoc @@ -23,4 +23,3 @@ with parameters, you may need to use {kotlin-docs}/annotations.html#annotation-use-site-targets[annotation use-site targets], such as `@field:NotNull` or `@get:Size(min=5, max=15)`, as described in {stackoverflow-site}/a/35853200/1092077[this Stack Overflow response]. - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/bean-definition-dsl.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/bean-definition-dsl.adoc index c2c2b9f246d..08441491422 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/bean-definition-dsl.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/bean-definition-dsl.adoc @@ -108,7 +108,3 @@ NOTE: Spring Boot is based on JavaConfig and but you can experimentally use functional bean definitions through Spring Boot's `ApplicationContextInitializer` support. See {stackoverflow-questions}/45935931/how-to-use-functional-bean-definition-kotlin-dsl-with-spring-boot-and-spring-w/46033685#46033685[this Stack Overflow answer] for more details and up-to-date information. See also the experimental Kofu DSL developed in {spring-github-org}-experimental/spring-fu[Spring Fu incubator]. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/classes-interfaces.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/classes-interfaces.adoc index 604563704a5..04cd2c8180d 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/classes-interfaces.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/classes-interfaces.adoc @@ -14,7 +14,3 @@ running the Kotlin compiler with its `-java-parameters` flag for standard Java p You can declare configuration classes as {kotlin-docs}/nested-classes.html[top level or nested but not inner], since the later requires a reference to the outer class. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc index 6893fb5a48c..7d8dd95ae73 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc @@ -20,7 +20,6 @@ Spring Framework provides support for Coroutines on the following scope: * Spring AOP - [[dependencies]] == Dependencies @@ -40,7 +39,6 @@ dependencies { Version `1.4.0` and above are supported. - [[how-reactive-translates-to-coroutines]] == How Reactive translates to Coroutines? @@ -69,7 +67,6 @@ Read this blog post about {spring-site-blog}/2019/04/12/going-reactive-with-spri for more details, including how to run code concurrently with Coroutines. - [[controllers]] == Controllers @@ -168,11 +165,12 @@ class CoroutinesViewController(banner: Banner) { ---- - [[webflux-fn]] == WebFlux.fn -Here is an example of Coroutines router defined via the {spring-framework-api-kdoc}/spring-webflux/org.springframework.web.reactive.function.server/co-router.html[coRouter { }] DSL and related handlers. +Here is an example of Coroutines router defined via the +{spring-framework-api-kdoc}/spring-webflux/org.springframework.web.reactive.function.server/co-router.html[coRouter { }] +DSL and related handlers. [source,kotlin,indent=0] ---- @@ -204,7 +202,6 @@ class UserHandler(builder: WebClient.Builder) { ---- - [[transactions]] == Transactions @@ -253,5 +250,3 @@ For Kotlin `Flow`, a `Flow.transactional` extension is provided. } } ---- - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/extensions.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/extensions.adoc index 6af9b086ae9..e8c94e7560a 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/extensions.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/extensions.adoc @@ -40,7 +40,3 @@ With Kotlin and the Spring Framework extensions, you can instead write the follo As in Java, `users` in Kotlin is strongly typed, but Kotlin's clever type inference allows for shorter syntax. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/getting-started.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/getting-started.adoc index 6b8b75b491e..2430258ce89 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/getting-started.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/getting-started.adoc @@ -5,7 +5,6 @@ The easiest way to learn how to build a Spring application with Kotlin is to fol {spring-site-guides}/tutorials/spring-boot-kotlin/[the dedicated tutorial]. - [[start-spring-io]] == `start.spring.io` @@ -13,7 +12,6 @@ The easiest way to start a new Spring Framework project in Kotlin is to create a Boot project on https://start.spring.io/#!language=kotlin&type=gradle-project-kotlin[start.spring.io]. - [[choosing-the-web-flavor]] == Choosing the Web Flavor @@ -25,7 +23,3 @@ long-lived connections or streaming scenarios. For other use cases, especially if you are using blocking technologies such as JPA, Spring MVC is the recommended choice. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/null-safety.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/null-safety.adoc index 96070d163f4..53de6bc135a 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/null-safety.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/null-safety.adoc @@ -32,7 +32,3 @@ be added in the future. NOTE: Generic type arguments, varargs, and array elements nullability are not supported yet, but should be in an upcoming release. See {kotlin-github-org}/KEEP/issues/79[this discussion] for up-to-date information. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/requirements.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/requirements.adoc index d2b3657d312..783ce3b2fd2 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/requirements.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/requirements.adoc @@ -12,7 +12,3 @@ NOTE: The {jackson-github-org}/jackson-module-kotlin[Jackson Kotlin module] is r for serializing or deserializing JSON data for Kotlin classes with Jackson, so make sure to add the `com.fasterxml.jackson.module:jackson-module-kotlin` dependency to your project if you have such need. It is automatically registered when found in the classpath. - - - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/resources.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/resources.adoc index f3be082c275..a8adbc915ff 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/resources.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/resources.adoc @@ -12,7 +12,6 @@ Kotlin and the Spring Framework: * https://kotlin.link/[Awesome Kotlin] - [[examples]] == Examples diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/spring-projects-in.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/spring-projects-in.adoc index 2a8670de074..89541990c3c 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/spring-projects-in.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/spring-projects-in.adoc @@ -5,7 +5,6 @@ This section provides some specific hints and recommendations worth for developi in Kotlin. - [[final-by-default]] == Final by Default @@ -53,7 +52,6 @@ NOTE: The Kotlin code samples in Spring Framework documentation do not explicitl using the `kotlin-allopen` plugin, since this is the most commonly used setup. - [[using-immutable-class-instances-for-persistence]] == Using Immutable Class Instances for Persistence @@ -99,7 +97,6 @@ does not require the `kotlin-noarg` plugin if the module uses Spring Data object (such as MongoDB, Redis, Cassandra, and others). - [[injecting-dependencies]] == Injecting Dependencies @@ -175,6 +172,7 @@ As a consequence, the related bean name represented as a Kotlin string is `"samp instead of `"sampleBean"` for the regular `public` function use-case. Make sure to use the mangled name when injecting such bean by name, or add `@JvmName("sampleBean")` to disable name mangling. + [[injecting-configuration-properties]] == Injecting Configuration Properties @@ -236,7 +234,6 @@ To get the original exception thrown like in Java, methods should be annotated w to specify explicitly the checked exceptions thrown (for example `@Throws(IOException::class)`). - [[annotation-array-attributes]] == Annotation Array Attributes @@ -283,7 +280,6 @@ NOTE: If the `@RequestMapping` `method` attribute is not specified, all HTTP met be matched, not only the `GET` method. - [[declaration-site-variance]] == Declaration-site variance @@ -319,7 +315,6 @@ subscribe to {spring-framework-issues}/22313[spring-framework#22313] to track re progresses. - [[testing]] == Testing @@ -330,7 +325,6 @@ https://mockk.io/[Mockk] for mocking. NOTE: If you are using Spring Boot, see {spring-boot-docs-ref}/features/kotlin.html#features.kotlin.testing[this related documentation]. - [[constructor-injection]] === Constructor injection @@ -355,7 +349,6 @@ file with a `spring.test.constructor.autowire.mode = all` property. } ---- - [[per_class-lifecycle]] === `PER_CLASS` Lifecycle @@ -400,7 +393,6 @@ class IntegrationTests { } ---- - [[specification-like-tests]] === Specification-like Tests @@ -431,5 +423,3 @@ The following example shows how to do so: } } ---- - - diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/web.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/web.adoc index 0bac57fe194..4f8458bbc3c 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/web.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/web.adoc @@ -1,6 +1,7 @@ [[kotlin-web]] = Web + [[router-dsl]] == Router DSL @@ -44,7 +45,6 @@ when you need to register routes depending on dynamic data (for example, from a See https://github.com/mixitconf/mixit/[MiXiT project] for a concrete example. - [[mockmvc-dsl]] == MockMvc DSL @@ -72,7 +72,6 @@ idiomatic Kotlin API and to allow better discoverability (no usage of static met ---- - [[kotlin-script-templates]] == Kotlin Script Templates @@ -120,7 +119,6 @@ See the https://github.com/sdeleuze/kotlin-script-templating[kotlin-script-templ project for more details. - [[kotlin-multiplatform-serialization]] == Kotlin multiplatform serialization @@ -132,4 +130,3 @@ With Spring MVC and WebFlux, both Kotlin serialization and Jackson will be confi Kotlin serialization is designed to serialize only Kotlin classes annotated with `@Serializable`. With Spring Messaging (RSocket), make sure that neither Jackson, GSON or JSONB are in the classpath if you want automatic configuration, if Jackson is needed configure `KotlinSerializationJsonMessageConverter` manually. - diff --git a/framework-docs/modules/ROOT/pages/overview.adoc b/framework-docs/modules/ROOT/pages/overview.adoc index da80bf35094..e7ff8af9a18 100644 --- a/framework-docs/modules/ROOT/pages/overview.adoc +++ b/framework-docs/modules/ROOT/pages/overview.adoc @@ -19,8 +19,6 @@ based on a diverse range of real-world use cases. This has helped Spring to succ evolve over a very long time. - - [[overview-spring]] == What We Mean by "Spring" @@ -45,8 +43,6 @@ the same naming pattern with `-` instead of `.` – for example, `spring-core` a Of course, Spring Framework's jars also work fine on the classpath. - - [[overview-history]] == History of Spring and the Spring Framework @@ -93,8 +89,6 @@ issue tracker, and release cadence. See {spring-site-projects}[spring.io/project the complete list of Spring projects. - - [[overview-philosophy]] == Design Philosophy @@ -119,8 +113,6 @@ meaningful, current, and accurate javadoc. It is one of very few projects that c clean code structure with no circular dependencies between packages. - - [[overview-feedback]] == Feedback and Contributions @@ -139,8 +131,6 @@ For more details see the guidelines at the {spring-framework-code}/CONTRIBUTING. top-level project page. - - [[overview-getting-started]] == Getting Started diff --git a/framework-docs/modules/ROOT/pages/rsocket.adoc b/framework-docs/modules/ROOT/pages/rsocket.adoc index 52e42adf800..05a7e8efe21 100644 --- a/framework-docs/modules/ROOT/pages/rsocket.adoc +++ b/framework-docs/modules/ROOT/pages/rsocket.adoc @@ -44,8 +44,6 @@ and {reactor-github-org}/reactor-netty[Reactor Netty] for the transport. That me signals from Reactive Streams Publishers in your application propagate transparently through RSocket across the network. - - [[rsocket-protocol]] === The Protocol @@ -100,8 +98,6 @@ Protocol extensions define common metadata formats for use in applications: independently formatted metadata entries. * {rsocket-protocol-extensions}/Routing.md[Routing] -- the route for a request. - - [[rsocket-java]] === Java Implementation @@ -130,8 +126,6 @@ with RSocket independent of Spring. The RSocket Java repository contains a numbe {rsocket-java-code}/rsocket-examples[sample apps] that demonstrate its API and protocol features. - - [[rsocket-spring]] === Spring Support @@ -163,7 +157,6 @@ clients and servers. See the Spring Integration Reference Manual for more detail Spring Cloud Gateway supports RSocket connections. - [[rsocket-requester]] == RSocketRequester @@ -171,7 +164,6 @@ Spring Cloud Gateway supports RSocket connections. returning objects for data and metadata instead of low level data buffers. It can be used symmetrically, to make requests from clients and to make requests from servers. - [[rsocket-requester-client]] === Client Requester @@ -208,7 +200,6 @@ Kotlin:: The above does not connect immediately. When requests are made, a shared connection is established transparently and used. - [[rsocket-requester-client-setup]] ==== Connection Setup @@ -226,10 +217,9 @@ metadata, the default mime type is metadata value and mime type pairs per request. Typically both don't need to be changed. Data and metadata in the `SETUP` frame is optional. On the server side, -xref:rsocket.adoc#rsocket-annot-connectmapping[@ConnectMapping] methods can be used to handle the start of a -connection and the content of the `SETUP` frame. Metadata may be used for connection -level security. - +xref:rsocket.adoc#rsocket-annot-connectmapping[@ConnectMapping] methods can be used to +handle the start of a connection and the content of the `SETUP` frame. Metadata may be +used for connection level security. [[rsocket-requester-client-strategies]] ==== Strategies @@ -274,7 +264,6 @@ Kotlin:: `RSocketStrategies` is designed for re-use. In some scenarios, for example, client and server in the same application, it may be preferable to declare it in Spring configuration. - [[rsocket-requester-client-responder]] ==== Client Responders @@ -368,7 +357,6 @@ application. See also xref:rsocket.adoc#rsocket-annot-responders[Annotated Responders], for more on the programming model. - [[rsocket-requester-client-advanced]] ==== Advanced @@ -402,7 +390,6 @@ Kotlin:: ---- ====== - [[rsocket-requester-server]] === Server Requester @@ -452,8 +439,6 @@ Kotlin:: <2> Perform handling in the suspending function. ====== - - [[rsocket-requester-requests]] === Requests @@ -578,7 +563,6 @@ indicates only that the message was successfully sent, and not that it was handl For `Metadata-Push` use the `sendMetadata()` method with a `Mono` return value. - [[rsocket-annot-responders]] == Annotated Responders @@ -587,8 +571,6 @@ RSocket responders can be implemented as `@MessageMapping` and `@ConnectMapping` connection-level events (setup and metadata push). Annotated responders are supported symmetrically, for responding from the server side and for responding from the client side. - - [[rsocket-annot-responders-server]] === Server Responders @@ -729,8 +711,6 @@ Kotlin:: ---- ====== - - [[rsocket-annot-responders-client]] === Client Responders @@ -738,8 +718,6 @@ Annotated responders on the client side need to be configured in the `RSocketRequester.Builder`. For details, see xref:rsocket.adoc#rsocket-requester-client-responder[Client Responders]. - - [[rsocket-annot-messagemapping]] === @MessageMapping @@ -863,8 +841,6 @@ interaction type(s): |=== - - [[rsocket-annot-rsocketexchange]] === @RSocketExchange @@ -927,7 +903,6 @@ xref:rsocket-interface[RSocket Interface] for a list of supported parameters. `@RSocketExchange` can be used at the type level to specify a common prefix for all routes for a given RSocket service interface. - [[rsocket-annot-connectmapping]] === @ConnectMapping @@ -948,8 +923,6 @@ requests to the `RSocketRequester` for the connection. See xref:rsocket.adoc#rsocket-requester-server[Server Requester] for details. - - [[rsocket-metadata-extractor]] == MetadataExtractor @@ -1057,8 +1030,6 @@ Kotlin:: ====== - - [[rsocket-interface]] == RSocket Interface @@ -1095,8 +1066,6 @@ Now you can create a proxy that performs requests when methods are called: You can also implement the interface to handle requests as a responder. See xref:rsocket.adoc#rsocket-annot-rsocketexchange[Annotated Responders]. - - [[rsocket-interface-method-parameters]] === Method Parameters @@ -1131,7 +1100,6 @@ method parameters: |=== - [[rsocket-interface-return-values]] === Return Values @@ -1144,4 +1112,3 @@ signature depends on response timeout settings of the underlying RSocket `Client as well as RSocket keep-alive settings. `RSocketServiceProxyFactory.Builder` does expose a `blockTimeout` option that also lets you configure the maximum time to block for a response, but we recommend configuring timeout values at the RSocket level for more control. - diff --git a/framework-docs/modules/ROOT/pages/testing.adoc b/framework-docs/modules/ROOT/pages/testing.adoc index ee17a98bb36..30664384c34 100644 --- a/framework-docs/modules/ROOT/pages/testing.adoc +++ b/framework-docs/modules/ROOT/pages/testing.adoc @@ -8,13 +8,3 @@ found that the correct use of inversion of control (IoC) certainly does make bot and integration testing easier (in that the presence of setter methods and appropriate constructors on classes makes them easier to wire together in a test without having to set up service locator registries and similar structures). - - - - - - - - - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations.adoc b/framework-docs/modules/ROOT/pages/testing/annotations.adoc index 844885ee0d2..f90d084d426 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations.adoc @@ -3,4 +3,3 @@ :page-section-summary-toc: 1 This section covers annotations that you can use when you test Spring applications. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc index d359c708ea7..b0366adccb6 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc @@ -13,6 +13,7 @@ xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupite * xref:testing/annotations/integration-junit-jupiter.adoc#integration-testing-annotations-junit-jupiter-disabledif[`@DisabledIf`] * xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[`@DisabledInAotMode`] + [[integration-testing-annotations-junit-jupiter-springjunitconfig]] == `@SpringJUnitConfig` @@ -85,6 +86,7 @@ See xref:testing/testcontext-framework/ctx-management.adoc[Context Management] a {spring-framework-api}/test/context/junit/jupiter/SpringJUnitConfig.html[`@SpringJUnitConfig`] and `@ContextConfiguration` for further details. + [[integration-testing-annotations-junit-jupiter-springjunitwebconfig]] == `@SpringJUnitWebConfig` @@ -162,6 +164,7 @@ See xref:testing/testcontext-framework/ctx-management.adoc[Context Management] a {spring-framework-api}/test/context/web/WebAppConfiguration.html[`@WebAppConfiguration`] for further details. + [[integration-testing-annotations-testconstructor]] == `@TestConstructor` @@ -195,6 +198,7 @@ use with JUnit Jupiter. Note that the `SpringExtension` is often automatically r for you – for example, when using annotations such as `@SpringJUnitConfig` and `@SpringJUnitWebConfig` or various test-related annotations from Spring Boot Test. + [[integration-testing-annotations-nestedtestconfiguration]] == `@NestedTestConfiguration` @@ -243,8 +247,9 @@ with `@Nested` test classes in JUnit Jupiter; however, there may be other testin frameworks with support for Spring and nested test classes that make use of this annotation. -See xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] for an example and further -details. +See xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] +for an example and further details. + [[integration-testing-annotations-junit-jupiter-enabledif]] == `@EnabledIf` @@ -312,6 +317,7 @@ if you wish to use Spring's `@EnabledIf` support make sure you import the annota from the correct package. ==== + [[integration-testing-annotations-junit-jupiter-disabledif]] == `@DisabledIf` @@ -377,6 +383,3 @@ Since JUnit 5.7, JUnit Jupiter also has a condition annotation named `@DisabledI if you wish to use Spring's `@DisabledIf` support make sure you import the annotation type from the correct package. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc index fdc6470f968..3ec7f14b2d5 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc @@ -11,6 +11,7 @@ xref:testing/testcontext-framework/support-classes.adoc#testcontext-support-clas * xref:testing/annotations/integration-junit4.adoc#integration-testing-annotations-junit4-timed[`@Timed`] * xref:testing/annotations/integration-junit4.adoc#integration-testing-annotations-junit4-repeat[`@Repeat`] + [[integration-testing-annotations-junit4-ifprofilevalue]] == `@IfProfileValue` @@ -168,6 +169,7 @@ preemptively fails the test if the test takes too long. Spring's `@Timed`, on th hand, does not preemptively fail the test but rather waits for the test to complete before failing. + [[integration-testing-annotations-junit4-repeat]] == `@Repeat` @@ -176,9 +178,9 @@ times that the test method is to be run is specified in the annotation. The scope of execution to be repeated includes execution of the test method itself as well as any setting up or tearing down of the test fixture. When used with the -xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-rules[`SpringMethodRule`], the scope additionally includes -preparation of the test instance by `TestExecutionListener` implementations. The -following example shows how to use the `@Repeat` annotation: +xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-rules[`SpringMethodRule`], +the scope additionally includes preparation of the test instance by `TestExecutionListener` +implementations. The following example shows how to use the `@Repeat` annotation: [tabs] ====== @@ -206,6 +208,3 @@ Kotlin:: ---- <1> Repeat this test ten times. ====== - - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring.adoc index 300c32dc891..8c500e124b5 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring.adoc @@ -30,4 +30,3 @@ Spring's testing annotations include the following: * xref:testing/annotations/integration-spring/annotation-sqlmergemode.adoc[`@SqlMergeMode`] * xref:testing/annotations/integration-spring/annotation-sqlgroup.adoc[`@SqlGroup`] * xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[`@DisabledInAotMode`] - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc index 62233f402d9..f6723c30f5d 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc @@ -76,4 +76,3 @@ See xref:testing/testcontext-framework/ctx-management/env-profiles.adoc[Context xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration], and the {spring-framework-api}/test/context/ActiveProfiles.html[`@ActiveProfiles`] javadoc for examples and further details. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-aftertransaction.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-aftertransaction.adoc index daa7c6995cf..299b8d3ed5c 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-aftertransaction.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-aftertransaction.adoc @@ -31,5 +31,3 @@ Kotlin:: ---- <1> Run this method after a transaction. ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-beforetransaction.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-beforetransaction.adoc index dc3cc242294..19083647ca2 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-beforetransaction.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-beforetransaction.adoc @@ -33,5 +33,3 @@ Kotlin:: ---- <1> Run this method before a transaction. ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc index a297b014994..65bf7e83777 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc @@ -6,4 +6,3 @@ the Spring TestContext Framework is bootstrapped. Specifically, you can use `@BootstrapWith` to specify a custom `TestContextBootstrapper`. See the section on xref:testing/testcontext-framework/bootstrapping.adoc[bootstrapping the TestContext framework] for further details. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-commit.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-commit.adoc index 555f8de110e..d1e956677c8 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-commit.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-commit.adoc @@ -35,5 +35,3 @@ Kotlin:: ---- <1> Commit the result of the test to the database. ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc index 5bd9ecc41ec..758b36f7809 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc @@ -39,7 +39,6 @@ Kotlin:: By default, `@ContextCustomizerFactories` provides support for inheriting factories from superclasses or enclosing classes. See -xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] and the -{spring-framework-api}/test/context/ContextCustomizerFactories.html[`@ContextCustomizerFactories` -javadoc] for an example and further details. - +xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] +and the {spring-framework-api}/test/context/ContextCustomizerFactories.html[`@ContextCustomizerFactories` javadoc] +for an example and further details. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc index a031e048e8e..552520d8100 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc @@ -69,7 +69,6 @@ Kotlin:: If you need to merge or override the configuration for a given level of the context hierarchy within a test class hierarchy, you must explicitly name that level by supplying the same value to the `name` attribute in `@ContextConfiguration` at each corresponding -level in the class hierarchy. See xref:testing/testcontext-framework/ctx-management/hierarchies.adoc[Context Hierarchies] and the -{spring-framework-api}/test/context/ContextHierarchy.html[`@ContextHierarchy`] javadoc +level in the class hierarchy. See xref:testing/testcontext-framework/ctx-management/hierarchies.adoc[Context Hierarchies] +and the {spring-framework-api}/test/context/ContextHierarchy.html[`@ContextHierarchy`] javadoc for further examples. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc index 4f7dd239946..3a2c8a2ed2c 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc @@ -259,4 +259,3 @@ Kotlin:: For further details regarding the `EXHAUSTIVE` and `CURRENT_LEVEL` algorithms, see the {spring-framework-api}/test/annotation/DirtiesContext.HierarchyMode.html[`DirtiesContext.HierarchyMode`] javadoc. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc index 3aeccb7f8cf..ed0705d21da 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc @@ -60,5 +60,5 @@ Kotlin:: <3> Register a dynamic `server.port` property to be retrieved lazily from the server. ====== -See xref:testing/testcontext-framework/ctx-management/dynamic-property-sources.adoc[Context Configuration with Dynamic Property Sources] for further details. - +See xref:testing/testcontext-framework/ctx-management/dynamic-property-sources.adoc[Context Configuration with Dynamic Property Sources] +for further details. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc index f92d5c584af..4cc25b1c176 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-mockitobean.adoc @@ -96,6 +96,7 @@ Such fields can therefore be `public`, `protected`, package-private (default vis or `private` depending on the needs or coding practices of the project. ==== + [[spring-testing-annotation-beanoverriding-mockitobean-examples]] == `@MockitoBean` Examples @@ -201,6 +202,7 @@ TIP: The mocks can also be injected into `@Configuration` classes or other test- components in the `ApplicationContext` in order to configure them with Mockito's stubbing APIs. + [[spring-testing-annotation-beanoverriding-mockitospybean-examples]] == `@MockitoSpyBean` Examples diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc index 15f41b4192b..5a37f56de50 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc @@ -11,4 +11,3 @@ The recorded events can be accessed via the `ApplicationEvents` API within tests See xref:testing/testcontext-framework/application-events.adoc[Application Events] and the {spring-framework-api}/test/context/event/RecordApplicationEvents.html[`@RecordApplicationEvents` javadoc] for an example and further details. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-rollback.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-rollback.adoc index 9edd2388545..bf4ef2a8a45 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-rollback.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-rollback.adoc @@ -41,5 +41,3 @@ Kotlin:: ---- <1> Do not roll back the result. ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sql.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sql.adoc index 09289d3f56d..17c4ec885a2 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sql.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sql.adoc @@ -32,6 +32,5 @@ Kotlin:: <1> Run two scripts for this test. ====== -See xref:testing/testcontext-framework/executing-sql.adoc#testcontext-executing-sql-declaratively[Executing SQL scripts declaratively with @Sql] for further details. - - +See xref:testing/testcontext-framework/executing-sql.adoc#testcontext-executing-sql-declaratively[Executing SQL scripts declaratively with @Sql] +for further details. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlconfig.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlconfig.adoc index a06c77fbf78..114aa7e6dba 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlconfig.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlconfig.adoc @@ -33,4 +33,3 @@ Kotlin:: ---- <1> Set the comment prefix and the separator in SQL scripts. ====== - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlgroup.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlgroup.adoc index fde8964b329..50e4976449d 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlgroup.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlgroup.adoc @@ -38,6 +38,3 @@ Kotlin:: ---- <1> Declare a group of SQL scripts. ====== - - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlmergemode.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlmergemode.adoc index 7cb26ee729d..36c5bb8c28e 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlmergemode.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-sqlmergemode.adoc @@ -90,5 +90,3 @@ Kotlin:: ---- <1> Set the `@Sql` merge mode to `MERGE` for a specific test method. ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc index aada318fdfa..33cb39c5c8f 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc @@ -38,9 +38,8 @@ Kotlin:: By default, `@TestExecutionListeners` provides support for inheriting listeners from superclasses or enclosing classes. See -xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] and the -{spring-framework-api}/test/context/TestExecutionListeners.html[`@TestExecutionListeners` -javadoc] for an example and further details. If you discover that you need to switch -back to using the default `TestExecutionListener` implementations, see the note -in xref:testing/testcontext-framework/tel-config.adoc#testcontext-tel-config-registering-tels[Registering `TestExecutionListener` Implementations]. - +xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-nested-test-configuration[`@Nested` test class configuration] +and the {spring-framework-api}/test/context/TestExecutionListeners.html[`@TestExecutionListeners` javadoc] +for an example and further details. If you discover that you need to switch +back to using the default `TestExecutionListener` implementations, see the note in +xref:testing/testcontext-framework/tel-config.adoc#testcontext-tel-config-registering-tels[Registering `TestExecutionListener` Implementations]. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc index 6971ec2209f..bfba63c0a75 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc @@ -65,5 +65,5 @@ Kotlin:: <1> Declare `timezone` and `port` properties. ====== -See xref:testing/testcontext-framework/ctx-management/property-sources.adoc[Context Configuration with Test Property Sources] for examples and further details. - +See xref:testing/testcontext-framework/ctx-management/property-sources.adoc[Context Configuration with Test Property Sources] +for examples and further details. diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc index 9256db492a0..fa697e62f9c 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc @@ -41,7 +41,6 @@ Kotlin:: ====== -- - To override the default, you can specify a different base resource path by using the implicit `value` attribute. Both `classpath:` and `file:` resource prefixes are supported. If no resource prefix is supplied, the path is assumed to be a file system @@ -82,4 +81,3 @@ Note that `@WebAppConfiguration` must be used in conjunction with hierarchy. See the {spring-framework-api}/test/context/web/WebAppConfiguration.html[`@WebAppConfiguration`] javadoc for further details. - diff --git a/framework-docs/modules/ROOT/pages/testing/annotations/integration-standard.adoc b/framework-docs/modules/ROOT/pages/testing/annotations/integration-standard.adoc index 4406377286d..31e4fc34349 100644 --- a/framework-docs/modules/ROOT/pages/testing/annotations/integration-standard.adoc +++ b/framework-docs/modules/ROOT/pages/testing/annotations/integration-standard.adoc @@ -32,6 +32,3 @@ the test class. On the other hand, if a method within a test class is annotated you use test lifecycle callbacks from the underlying test framework instead of `@PostConstruct` and `@PreDestroy`. ==== - - - diff --git a/framework-docs/modules/ROOT/pages/testing/appendix.adoc b/framework-docs/modules/ROOT/pages/testing/appendix.adoc index 0f1591ce97a..404036a7acc 100644 --- a/framework-docs/modules/ROOT/pages/testing/appendix.adoc +++ b/framework-docs/modules/ROOT/pages/testing/appendix.adoc @@ -1,5 +1,3 @@ [[appendix]] = Appendix :page-section-summary-toc: 1 - - diff --git a/framework-docs/modules/ROOT/pages/testing/integration.adoc b/framework-docs/modules/ROOT/pages/testing/integration.adoc index 79c2a832115..26479855690 100644 --- a/framework-docs/modules/ROOT/pages/testing/integration.adoc +++ b/framework-docs/modules/ROOT/pages/testing/integration.adoc @@ -35,7 +35,6 @@ integration support, and the rest of this chapter then focuses on dedicated topi * xref:testing/annotations.adoc[Annotations] - [[integration-testing-goals]] == Goals of Integration Testing @@ -50,7 +49,6 @@ Spring's integration testing support has the following primary goals: The next few sections describe each goal and provide links to implementation and configuration details. - [[testing-ctx-management]] === Context Management and Caching @@ -78,10 +76,10 @@ reloading (for example, by modifying a bean definition or the state of an applic object) the TestContext framework can be configured to reload the configuration and rebuild the application context before executing the next test. -See xref:testing/testcontext-framework/ctx-management.adoc[Context Management] and xref:testing/testcontext-framework/ctx-management/caching.adoc[Context Caching] with the +See xref:testing/testcontext-framework/ctx-management.adoc[Context Management] and +xref:testing/testcontext-framework/ctx-management/caching.adoc[Context Caching] with the TestContext framework. - [[testing-fixture-di]] === Dependency Injection of Test Fixtures @@ -107,7 +105,6 @@ integration tests that test the following areas: See dependency injection of test fixtures with the xref:testing/testcontext-framework/fixture-di.adoc[TestContext framework]. - [[testing-tx]] === Transaction Management @@ -132,7 +129,6 @@ xref:testing/annotations.adoc[`@Commit`] annotation. See transaction management with the xref:testing/testcontext-framework/tx.adoc[TestContext framework]. - [[testing-support-classes]] === Support Classes for Integration Testing diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc.adoc index ac42f4be5e5..97bb2927255 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc.adoc @@ -12,5 +12,3 @@ the server to handle requests. The advantage of using `WebTestClient` is that it you the option of working with higher level objects instead of raw data as well as the ability to switch to full, end-to-end HTTP tests against a live server and use the same test API. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj.adoc index aa105c91b2a..932a8fd73ae 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj.adoc @@ -13,4 +13,4 @@ or not. In other words, there is no need for special handling for Async requests `MockMvcTester` is the entry point for the AssertJ support. It allows to craft the request and return a result that is AssertJ compatible so that it can be wrapped in -a standard `assertThat()` method. \ No newline at end of file +a standard `assertThat()` method. diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/assertions.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/assertions.adoc index bb3a9ca2bc4..aa371b3e765 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/assertions.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/assertions.adoc @@ -17,6 +17,7 @@ has not been handled and is thrown as is. You can still use `.hasFailed()` and `.failure()` but any attempt to access part of the result will throw an exception as the exchange hasn't completed. + [[mockmvc-tester-assertions-json]] == JSON Support diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/integration.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/integration.adoc index 25a77205d9a..5d6f04436a8 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/integration.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/integration.adoc @@ -19,5 +19,3 @@ include-code::./HotelControllerTests[tag=matches,indent=0] `MockMvc` also defines a `ResultHandler` contract that lets you execute arbitrary actions on `MvcResult`. If you have implemented this contract you can invoke it using `.apply`. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/requests.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/requests.adoc index 9889532fc1d..93dcfa5591f 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/requests.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/assertj/requests.adoc @@ -51,6 +51,7 @@ include-code::./AsyncControllerTests[tag=duration,indent=0] If you prefer to get the raw result and manage the lifecycle of the asynchronous request yourself, use `asyncExchange` rather than `exchange`. + [[mockmvc-tester-requests-multipart]] == Multipart @@ -60,6 +61,7 @@ request. Rather, you have to set it up to be similar to the following example: include-code::./MultipartControllerTests[tag=snippet,indent=0] + [[mockmvc-tester-requests-paths]] == Using Servlet and Context Paths @@ -80,4 +82,3 @@ The preceding properties affect every request performed through the `mockMvc` in If the same property is also specified on a given request, it overrides the default value. That is why the HTTP method and URI in the default request do not matter, since they must be specified on every request. - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest.adoc index 46a1ecfa4e1..629a051ef28 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest.adoc @@ -4,4 +4,4 @@ Plain `MockMvc` provides an API to build the request using a builder-style approach that can be initiated with static imports. Hamcrest is used to define expectations and -it provides many out-of-the-box options for common needs. \ No newline at end of file +it provides many out-of-the-box options for common needs. diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/async-requests.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/async-requests.adoc index f6f5d9f14f1..1defcfbc866 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/async-requests.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/async-requests.adoc @@ -70,5 +70,3 @@ Kotlin:: <4> Manually perform an ASYNC dispatch (as there is no running container) <5> Verify the final response ====== - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/expectations.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/expectations.adoc index a7cb4d3b368..5206b34d97f 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/expectations.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/expectations.adoc @@ -248,4 +248,3 @@ Kotlin:: } ---- ====== - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/filters.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/filters.adoc index 5060f27c3d6..d61a9f1b174 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/filters.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/filters.adoc @@ -24,5 +24,3 @@ Kotlin:: Registered filters are invoked through the `MockFilterChain` from `spring-test`, and the last filter delegates to the `DispatcherServlet`. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/requests.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/requests.adoc index a7b565abddd..cc85e2846ad 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/requests.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/requests.adoc @@ -167,4 +167,3 @@ The preceding properties affect every request performed through the `MockMvc` in If the same property is also specified on a given request, it overrides the default value. That is why the HTTP method and URI in the default request do not matter, since they must be specified on every request. - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup-steps.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup-steps.adoc index ab426c43f33..8cda0b66b03 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup-steps.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup-steps.adoc @@ -60,4 +60,3 @@ Kotlin:: See the javadoc for {spring-framework-api}/test/web/servlet/setup/ConfigurableMockMvcBuilder.html[`ConfigurableMockMvcBuilder`] for a list of all MockMvc builder features or use the IDE to explore the available options. - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup.adoc index 1e87ae7c915..eeaa1951bd3 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/setup.adoc @@ -96,5 +96,5 @@ Kotlin:: ====== Or you can also use this setup when testing through the -xref:testing/webtestclient.adoc#webtestclient-context-config[WebTestClient] which delegates to the same builder -as shown above. +xref:testing/webtestclient.adoc#webtestclient-context-config[WebTestClient] +which delegates to the same builder as shown above. diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/static-imports.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/static-imports.adoc index 652eef58b31..a645efe2807 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/static-imports.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/static-imports.adoc @@ -14,5 +14,3 @@ add the above as "`favorite static members`" in the Eclipse preferences. When using MockMvc through the xref:testing/webtestclient.adoc[WebTestClient] you do not need static imports. The `WebTestClient` provides a fluent API without static imports. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/vs-streaming-response.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/vs-streaming-response.adoc index 18813c7c529..e44695650cb 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/vs-streaming-response.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/hamcrest/vs-streaming-response.adoc @@ -12,5 +12,3 @@ or when using Spring Boot, `MockMvcWebTestClient` does support asynchronous responses, and even streaming responses. The limitation is that it can't influence the server to stop, and therefore the server must finish writing the response on its own. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/htmlunit.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/htmlunit.adoc index 52cbacc3e79..652e29da658 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/htmlunit.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/htmlunit.adoc @@ -18,4 +18,3 @@ when using HTML-based views. This integration lets you: NOTE: MockMvc works with templating technologies that do not rely on a Servlet Container (for example, Thymeleaf, FreeMarker, and others), but it does not work with JSPs, since they rely on the Servlet container. - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/overview.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/overview.adoc index a1571c1bd93..84851b2d95f 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/overview.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/overview.adoc @@ -20,5 +20,3 @@ to perform requests and to verify responses using Hamcrest or through `MockMvcTe which provides a fluent API using AssertJ. You can also use it through the xref:testing/webtestclient.adoc[WebTestClient] API with MockMvc plugged in as the server to handle requests. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/resources.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/resources.adoc index f749cead6f0..e0da2f74616 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/resources.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/resources.adoc @@ -7,5 +7,3 @@ The framework's own test suite includes many sample tests] intended to show how to use MockMvc on its own or through the {spring-framework-code}/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client[ WebTestClient]. Browse these examples for further ideas. - - diff --git a/framework-docs/modules/ROOT/pages/testing/mockmvc/vs-end-to-end-integration-tests.adoc b/framework-docs/modules/ROOT/pages/testing/mockmvc/vs-end-to-end-integration-tests.adoc index 4a4e2eee7a7..9ca38e589d0 100644 --- a/framework-docs/modules/ROOT/pages/testing/mockmvc/vs-end-to-end-integration-tests.adoc +++ b/framework-docs/modules/ROOT/pages/testing/mockmvc/vs-end-to-end-integration-tests.adoc @@ -43,4 +43,3 @@ reason about, and debug but does not replace the need for full integration tests same time, it is important not to lose sight of the fact that the response is the most important thing to check. In short, there is room for multiple styles and strategies of testing even within the same project. - diff --git a/framework-docs/modules/ROOT/pages/testing/spring-mvc-test-client.adoc b/framework-docs/modules/ROOT/pages/testing/spring-mvc-test-client.adoc index b145277f21c..81fca95595b 100644 --- a/framework-docs/modules/ROOT/pages/testing/spring-mvc-test-client.adoc +++ b/framework-docs/modules/ROOT/pages/testing/spring-mvc-test-client.adoc @@ -212,6 +212,7 @@ In the second case, the request is executed through the `ClientHttpRequestFactor captured earlier. This generates a response that could, for example, come from an actual remote server, depending on how the `RestTemplate` was originally configured. + [[spring-mvc-test-client-static-imports]] == Static Imports diff --git a/framework-docs/modules/ROOT/pages/testing/support-jdbc.adoc b/framework-docs/modules/ROOT/pages/testing/support-jdbc.adoc index b2283e6723e..6d76ab2e18a 100644 --- a/framework-docs/modules/ROOT/pages/testing/support-jdbc.adoc +++ b/framework-docs/modules/ROOT/pages/testing/support-jdbc.adoc @@ -1,6 +1,7 @@ [[integration-testing-support-jdbc]] = JDBC Testing Support + [[integration-testing-support-jdbc-test-utils]] == JdbcTestUtils diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework.adoc index 0cf24faa9aa..d0e086cb71e 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework.adoc @@ -19,8 +19,7 @@ The following section provides an overview of the internals of the TestContext f If you are interested only in using the framework and are not interested in extending it with your own custom listeners or custom loaders, feel free to go directly to the configuration (xref:testing/testcontext-framework/ctx-management.adoc[context management], -xref:testing/testcontext-framework/fixture-di.adoc[dependency injection], xref:testing/testcontext-framework/tx.adoc[transaction management] -), xref:testing/testcontext-framework/support-classes.adoc[support classes], and +xref:testing/testcontext-framework/fixture-di.adoc[dependency injection], +xref:testing/testcontext-framework/tx.adoc[transaction management]), +xref:testing/testcontext-framework/support-classes.adoc[support classes], and xref:testing/annotations.adoc[annotation support] sections. - - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/application-events.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/application-events.adoc index f0f40db9655..659cf33a4cf 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/application-events.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/application-events.adoc @@ -90,4 +90,3 @@ Kotlin:: See the {spring-framework-api}/test/context/event/ApplicationEvents.html[`ApplicationEvents` javadoc] for further details regarding the `ApplicationEvents` API. - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/bootstrapping.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/bootstrapping.adoc index bf3be0e663a..8e83014d251 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/bootstrapping.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/bootstrapping.adoc @@ -22,5 +22,3 @@ Since the `TestContextBootstrapper` SPI is likely to change in the future (to ac new requirements), we strongly encourage implementers not to implement this interface directly but rather to extend `AbstractTestContextBootstrapper` or one of its concrete subclasses instead. - - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc index 880f7832e20..393c30a8a19 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management.adoc @@ -122,4 +122,3 @@ advanced use cases. * xref:testing/testcontext-framework/ctx-management/caching.adoc[Context Caching] * xref:testing/testcontext-framework/ctx-management/failure-threshold.adoc[Context Failure Threshold] * xref:testing/testcontext-framework/ctx-management/hierarchies.adoc[Context Hierarchies] - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/executing-sql.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/executing-sql.adoc index 44613c34832..0ef8443eaea 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/executing-sql.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/executing-sql.adoc @@ -14,6 +14,7 @@ Although it is very useful to initialize a database for testing _once_ when the database _during_ integration tests. The following sections explain how to run SQL scripts programmatically and declaratively during integration tests. + [[testcontext-executing-sql-programmatically]] == Executing SQL scripts programmatically @@ -88,6 +89,7 @@ and xref:testing/testcontext-framework/support-classes.adoc#testcontext-support- internally use a `ResourceDatabasePopulator` to run SQL scripts. See the Javadoc for the various `executeSqlScript(..)` methods for further details. + [[testcontext-executing-sql-declaratively]] == Executing SQL scripts declaratively with @Sql @@ -504,7 +506,6 @@ database schema or some common test data once per test class and then provide ad use case specific test data per test method. To enable `@Sql` merging, annotate either your test class or test method with `@SqlMergeMode(MERGE)`. To disable merging for a specific test method (or specific test subclass), you can switch back to the default mode -via `@SqlMergeMode(OVERRIDE)`. Consult the xref:testing/annotations/integration-spring/annotation-sqlmergemode.adoc[`@SqlMergeMode` annotation documentation section] - for examples and further details. - - +via `@SqlMergeMode(OVERRIDE)`. Consult the +xref:testing/annotations/integration-spring/annotation-sqlmergemode.adoc[`@SqlMergeMode` annotation documentation section] +for examples and further details. diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc index c0d352e4393..5889c6a51d6 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc @@ -7,9 +7,10 @@ application context that you configured with `@ContextConfiguration` or related annotations. You may use setter injection, field injection, or both, depending on which annotations you choose and whether you place them on setter methods or fields. If you are using JUnit Jupiter you may also optionally use constructor injection -(see xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-di[Dependency Injection with `SpringExtension`]). For consistency with Spring's annotation-based -injection support, you may also use Spring's `@Autowired` annotation or the `@Inject` -annotation from JSR-330 for field and setter injection. +(see xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-di[Dependency Injection with `SpringExtension`]). +For consistency with Spring's annotation-based injection support, you may also use +Spring's `@Autowired` annotation or the `@Inject` annotation from JSR-330 for +field and setter injection. TIP: For testing frameworks other than JUnit Jupiter, the TestContext framework does not participate in instantiation of the test class. Thus, the use of `@Autowired` or @@ -35,9 +36,9 @@ dependency injection altogether by explicitly configuring your class with from the list of listeners. Consider the scenario of testing a `HibernateTitleRepository` class, as outlined in the -xref:testing/integration.adoc#integration-testing-goals[Goals] section. The next two code listings demonstrate the -use of `@Autowired` on fields and setter methods. The application context configuration -is presented after all sample code listings. +xref:testing/integration.adoc#integration-testing-goals[Goals] section. The next two code +listings demonstrate the use of `@Autowired` on fields and setter methods. The application +context configuration is presented after all sample code listings. [NOTE] ==== @@ -226,5 +227,3 @@ narrowing the set of type matches to a specific bean. Its value is matched again is used as a fallback qualifier value, so you can effectively also point to a specific bean by name there (as shown earlier, assuming that `myDataSource` is the bean `id`). ===== - - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/key-abstractions.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/key-abstractions.adoc index 6910ce06fb9..ba6407d377b 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/key-abstractions.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/key-abstractions.adoc @@ -13,6 +13,7 @@ test execution by providing dependency injection, managing transactions, and so class. See the {spring-framework-api}/test/context/package-summary.html[javadoc] and the Spring test suite for further information and examples of various implementations. + [[testcontext]] == `TestContext` @@ -21,6 +22,7 @@ actual testing framework in use) and provides context management and caching sup the test instance for which it is responsible. The `TestContext` also delegates to a `SmartContextLoader` to load an `ApplicationContext` if requested. + [[testcontextmanager]] == `TestContextManager` @@ -36,11 +38,14 @@ responsible for managing a single `TestContext` and signaling events to each reg * After any "`after`" or "`after each`" methods of a particular testing framework. * After any "`after class`" or "`after all`" methods of a particular testing framework. + [[testexecutionlistener]] == `TestExecutionListener` `TestExecutionListener` defines the API for reacting to test-execution events published by -the `TestContextManager` with which the listener is registered. See xref:testing/testcontext-framework/tel-config.adoc[`TestExecutionListener` Configuration]. +the `TestContextManager` with which the listener is registered. See +xref:testing/testcontext-framework/tel-config.adoc[`TestExecutionListener` Configuration]. + [[context-loaders]] == Context Loaders @@ -82,5 +87,3 @@ Spring provides the following implementations: locations. * `GenericXmlWebContextLoader`: Loads a `WebApplicationContext` from XML resource locations. - - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/parallel-test-execution.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/parallel-test-execution.adoc index c95363d9462..9cfa44c145f 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/parallel-test-execution.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/parallel-test-execution.adoc @@ -44,4 +44,3 @@ the javadoc for {spring-framework-api}/test/context/TestContext.html[`TestContex `DefaultTestContext` used in Spring provides such a constructor. However, if you use a third-party library that provides a custom `TestContext` implementation, you need to verify that it is suitable for parallel test execution. - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc index a7798005873..c3eacf558ba 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc @@ -169,7 +169,6 @@ Specifically, the `SpringExtension` can inject dependencies from the test's `@BeforeTransaction` and `@AfterTransaction` or JUnit's `@BeforeAll`, `@AfterAll`, `@BeforeEach`, `@AfterEach`, `@Test`, `@RepeatedTest`, `@ParameterizedTest`, and others. - [[testcontext-junit-jupiter-di-constructor]] ==== Constructor Injection @@ -679,4 +678,3 @@ to be tied to a Spring-specific class hierarchy, you can configure your own cust classes by using `@ContextConfiguration`, `@TestExecutionListeners`, and so on and by manually instrumenting your test class with a `TestContextManager`. See the source code of `AbstractTestNGSpringContextTests` for an example of how to instrument your test class. - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tel-config.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tel-config.adoc index 1d6c2d64979..0b89b067241 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tel-config.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tel-config.adoc @@ -28,6 +28,7 @@ by default, exactly in the following order: `ApplicationContext` (see xref:testing/testcontext-framework/test-execution-events.adoc[Test Execution Events]). * `MockitoResetTestExecutionListener`: Resets mocks as configured by `@MockitoBean` or `@MockitoSpyBean`. + [[testcontext-tel-config-registering-tels]] == Registering `TestExecutionListener` Implementations @@ -76,6 +77,7 @@ Kotlin:: ====== ==== + [[testcontext-tel-config-automatic-discovery]] == Automatic Discovery of Default `TestExecutionListener` Implementations @@ -92,6 +94,7 @@ properties file]. Third-party frameworks and developers can contribute their own `TestExecutionListener` implementations to the list of default listeners in the same manner through their own `spring.factories` files. + [[testcontext-tel-config-ordering]] == Ordering `TestExecutionListener` Implementations @@ -107,6 +110,7 @@ by implementing `Ordered` or declaring `@Order`. See the javadoc for the `getOrd methods of the core default `TestExecutionListener` implementations for details on what values are assigned to each core listener. + [[testcontext-tel-config-merging]] == Merging `TestExecutionListener` Implementations diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/test-execution-events.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/test-execution-events.adoc index 922f9e2fb4c..90f2fee4a74 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/test-execution-events.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/test-execution-events.adoc @@ -66,6 +66,7 @@ package. * `@AfterTestMethod` * `@AfterTestClass` + [[testcontext-test-execution-events-exception-handling]] == Exception Handling @@ -77,12 +78,11 @@ contrast, if an asynchronous test execution event listener throws an exception, exception will not propagate to the underlying testing framework. For further details on asynchronous exception handling, consult the class-level javadoc for `@EventListener`. + [[testcontext-test-execution-events-async]] == Asynchronous Listeners If you want a particular test execution event listener to process events asynchronously, -you can use Spring's xref:integration/scheduling.adoc#scheduling-annotation-support-async[regular `@Async` support] -. For further details, consult the class-level javadoc for -`@EventListener`. - - +you can use Spring's +xref:integration/scheduling.adoc#scheduling-annotation-support-async[regular `@Async` support]. +For further details, consult the class-level javadoc for `@EventListener`. diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc index 875e24a21f8..e1e03b50464 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc @@ -9,6 +9,7 @@ transactions, however, you must configure a `PlatformTransactionManager` bean in details are provided later). In addition, you must declare Spring's `@Transactional` annotation either at the class or the method level for your tests. + [[testcontext-tx-test-managed-transactions]] == Test-managed Transactions @@ -46,6 +47,7 @@ Situations in which this can occur include but are not limited to the following. * TestNG's `@Test(timeOut = ...)` support ==== + [[testcontext-tx-enabling-transactions]] == Enabling and Disabling Transactions @@ -193,9 +195,11 @@ Kotlin:: ---- ====== -As explained in xref:testing/testcontext-framework/tx.adoc#testcontext-tx-rollback-and-commit-behavior[Transaction Rollback and Commit Behavior], there is no need to -clean up the database after the `createUser()` method runs, since any changes made to the -database are automatically rolled back by the `TransactionalTestExecutionListener`. +As explained in xref:testing/testcontext-framework/tx.adoc#testcontext-tx-rollback-and-commit-behavior[Transaction Rollback and Commit Behavior], +there is no need to clean up the database after the `createUser()` method runs, +since any changes made to the database are automatically rolled back by the +`TransactionalTestExecutionListener`. + [[testcontext-tx-rollback-and-commit-behavior]] == Transaction Rollback and Commit Behavior @@ -205,6 +209,7 @@ test; however, transactional commit and rollback behavior can be configured decl via the `@Commit` and `@Rollback` annotations. See the corresponding entries in the xref:testing/annotations.adoc[annotation support] section for further details. + [[testcontext-tx-programmatic-tx-mgt]] == Programmatic Transaction Management @@ -285,6 +290,7 @@ Kotlin:: ---- ====== + [[testcontext-tx-before-and-after-tx]] == Running Code Outside of a Transaction @@ -346,6 +352,7 @@ Similarly, methods annotated with `@BeforeTransaction` or `@AfterTransaction` ar run for transactional test methods. ==== + [[testcontext-tx-mgr-config]] == Configuring a Transaction Manager @@ -359,6 +366,7 @@ qualifier by using `@Transactional("myTxMgr")` or `@Transactional(transactionMan for `TestContextTransactionUtils.retrieveTransactionManager()`] for details on the algorithm used to look up a transaction manager in the test's `ApplicationContext`. + [[testcontext-tx-annotation-demo]] == Demonstration of All Transaction-related Annotations @@ -671,5 +679,3 @@ See {spring-framework-code}/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/orm/JpaEntityListenerTests.java[JpaEntityListenerTests] in the Spring Framework test suite for working examples using all JPA lifecycle callbacks. ===== - - diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/web-scoped-beans.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/web-scoped-beans.adoc index f716f1d9612..0110a619495 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/web-scoped-beans.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/web-scoped-beans.adoc @@ -168,4 +168,3 @@ Kotlin:: } ---- ====== - diff --git a/framework-docs/modules/ROOT/pages/testing/unit.adoc b/framework-docs/modules/ROOT/pages/testing/unit.adoc index ddc70fd18f8..2b360936eaf 100644 --- a/framework-docs/modules/ROOT/pages/testing/unit.adoc +++ b/framework-docs/modules/ROOT/pages/testing/unit.adoc @@ -19,7 +19,6 @@ however, the Spring Framework provides mock objects and testing support classes, are described in this chapter. - [[mock-objects]] == Mock Objects @@ -29,7 +28,6 @@ Spring includes a number of packages dedicated to mocking: * xref:testing/unit.adoc#mock-objects-servlet[Servlet API] * xref:testing/unit.adoc#mock-objects-web-reactive[Spring Web Reactive] - [[mock-objects-env]] === Environment @@ -40,7 +38,6 @@ and xref:core/beans/environment.adoc#beans-property-source-abstraction[`Property `MockEnvironment` and `MockPropertySource` are useful for developing out-of-container tests for code that depends on environment-specific properties. - [[mock-objects-servlet]] === Servlet API @@ -55,7 +52,6 @@ based on the Servlet 6.0 API. MockMvc builds on the mock Servlet API objects to provide an integration testing framework for Spring MVC. See xref:testing/mockmvc.adoc[MockMvc]. - [[mock-objects-web-reactive]] === Spring Web Reactive @@ -79,7 +75,6 @@ testing WebFlux applications without an HTTP server. The client can also be used end-to-end tests with a running server. - [[unit-testing-support-classes]] == Unit Testing Support Classes @@ -89,7 +84,6 @@ categories: * xref:testing/unit.adoc#unit-testing-utilities[General Testing Utilities] * xref:testing/unit.adoc#unit-testing-spring-mvc[Spring MVC Testing Utilities] - [[unit-testing-utilities]] === General Testing Utilities @@ -134,7 +128,6 @@ assigned by the operating system. To interact with that server, you should query server for the port it is currently using. ==== - [[unit-testing-spring-mvc]] === Spring MVC Testing Utilities @@ -146,7 +139,7 @@ that deal with Spring MVC `ModelAndView` objects. .Unit testing Spring MVC Controllers TIP: To unit test your Spring MVC `Controller` classes as POJOs, use `ModelAndViewAssert` combined with `MockHttpServletRequest`, `MockHttpSession`, and so on from Spring's -xref:testing/unit.adoc#mock-objects-servlet[Servlet API mocks]. For thorough integration testing of your -Spring MVC and REST `Controller` classes in conjunction with your `WebApplicationContext` -configuration for Spring MVC, use the +xref:testing/unit.adoc#mock-objects-servlet[Servlet API mocks]. For thorough integration +testing of your Spring MVC and REST `Controller` classes in conjunction with your +`WebApplicationContext` configuration for Spring MVC, use xref:testing/mockmvc.adoc[MockMvc] instead. diff --git a/framework-docs/modules/ROOT/pages/testing/webtestclient.adoc b/framework-docs/modules/ROOT/pages/testing/webtestclient.adoc index b155859ee5a..836e39f4058 100644 --- a/framework-docs/modules/ROOT/pages/testing/webtestclient.adoc +++ b/framework-docs/modules/ROOT/pages/testing/webtestclient.adoc @@ -8,16 +8,12 @@ perform end-to-end HTTP tests. It can also be used to test Spring MVC and Spring applications without a running server via mock server request and response objects. - - [[webtestclient-setup]] == Setup To set up a `WebTestClient` you need to choose a server setup to bind to. This can be one of several mock server setup choices or a connection to a live server. - - [[webtestclient-controller-config]] === Bind to Controller @@ -71,8 +67,6 @@ Kotlin:: ---- ====== - - [[webtestclient-context-config]] === Bind to `ApplicationContext` @@ -188,8 +182,6 @@ Kotlin:: <3> Create the `WebTestClient` ====== - - [[webtestclient-fn-config]] === Bind to Router Function @@ -221,8 +213,6 @@ Kotlin:: For Spring MVC there are currently no options to test xref:web/webmvc-functional.adoc[WebMvc functional endpoints]. - - [[webtestclient-server-config]] === Bind to Server @@ -245,8 +235,6 @@ Kotlin:: ---- ====== - - [[webtestclient-client-config]] === Client Config @@ -280,8 +268,6 @@ Kotlin:: ====== - - [[webtestclient-tests]] == Writing Tests @@ -455,8 +441,6 @@ that accept {spring-framework-api}/core/ParameterizedTypeReference.html[`ParameterizedTypeReference`] instead of `Class`. - - [[webtestclient-no-content]] === No Content @@ -513,8 +497,6 @@ Kotlin:: ---- ====== - - [[webtestclient-json]] === JSON Content @@ -577,8 +559,6 @@ Kotlin:: ---- ====== - - [[webtestclient-stream]] === Streaming Responses @@ -647,7 +627,6 @@ Kotlin:: ---- ====== - [[webtestclient-mockmvc]] === MockMvc Assertions diff --git a/framework-docs/modules/ROOT/pages/web-reactive.adoc b/framework-docs/modules/ROOT/pages/web-reactive.adoc index 378d65ef591..ff774a42514 100644 --- a/framework-docs/modules/ROOT/pages/web-reactive.adoc +++ b/framework-docs/modules/ROOT/pages/web-reactive.adoc @@ -2,11 +2,11 @@ = Web on Reactive Stack This part of the documentation covers support for reactive-stack web applications built -on a {reactive-streams-site}/[Reactive Streams] API to run on non-blocking -servers, such as Netty, Undertow, and Servlet containers. Individual chapters cover +on a {reactive-streams-site}/[Reactive Streams] API to run on non-blocking servers, +such as Netty, Undertow, and Servlet containers. Individual chapters cover the xref:web/webflux.adoc#webflux[Spring WebFlux] framework, the reactive xref:web/webflux-webclient.adoc[`WebClient`], support for xref:web/webflux-test.adoc[testing], -and xref:web/webflux-reactive-libraries.adoc[reactive libraries]. For Servlet-stack web -applications, see xref:web.adoc[Web on Servlet Stack]. +and xref:web/webflux-reactive-libraries.adoc[reactive libraries]. +For Servlet-stack web applications, see xref:web.adoc[Web on Servlet Stack]. diff --git a/framework-docs/modules/ROOT/pages/web.adoc b/framework-docs/modules/ROOT/pages/web.adoc index e8a18f927c8..d579e65f476 100644 --- a/framework-docs/modules/ROOT/pages/web.adoc +++ b/framework-docs/modules/ROOT/pages/web.adoc @@ -2,8 +2,11 @@ = Web on Servlet Stack :page-section-summary-toc: 1 -This part of the documentation covers support for Servlet-stack web applications built on the -Servlet API and deployed to Servlet containers. Individual chapters include xref:web/webmvc.adoc#mvc[Spring MVC], -xref:web/webmvc-view.adoc[View Technologies], xref:web/webmvc-cors.adoc[CORS Support], and xref:web/websocket.adoc[WebSocket Support]. -For reactive-stack web applications, see xref:web-reactive.adoc[Web on Reactive Stack]. +This part of the documentation covers support for Servlet-stack web applications built +on the Servlet API and deployed to Servlet containers. Individual chapters include +xref:web/webmvc.adoc#mvc[Spring MVC], +xref:web/webmvc-view.adoc[View Technologies], +xref:web/webmvc-cors.adoc[CORS Support], and +xref:web/websocket.adoc[WebSocket Support]. +For reactive-stack web applications, see xref:web-reactive.adoc[Web on Reactive Stack]. diff --git a/framework-docs/modules/ROOT/pages/web/integration.adoc b/framework-docs/modules/ROOT/pages/web/integration.adoc index ed280eb57b1..d39a9ff0617 100644 --- a/framework-docs/modules/ROOT/pages/web/integration.adoc +++ b/framework-docs/modules/ROOT/pages/web/integration.adoc @@ -9,10 +9,9 @@ particular architecture, technology, or methodology (although it certainly recom some over others). This freedom to pick and choose the architecture, technology, or methodology that is most relevant to a developer and their development team is arguably most evident in the web area, where Spring provides its own web frameworks -(xref:web/webmvc.adoc#mvc[Spring MVC] and xref:web/webflux.adoc#webflux[Spring WebFlux]) while, at the same time, -supporting integration with a number of popular third-party web frameworks. - - +(xref:web/webmvc.adoc#mvc[Spring MVC] and xref:web/webflux.adoc#webflux[Spring WebFlux]) +while, at the same time, supporting integration with a number of popular third-party +web frameworks. [[web-integration-common]] @@ -96,8 +95,6 @@ use dependency injection on their controllers. Each web framework section has mo on its specific integration strategies. - - [[jsf]] == JSF @@ -112,8 +109,6 @@ exists for migration purposes when modernizing older JSF-based applications. The key element in Spring's JSF integration is the JSF `ELResolver` mechanism. - - [[jsf-springbeanfaceselresolver]] === Spring Bean Resolver @@ -135,8 +130,6 @@ Configuration-wise, you can define `SpringBeanFacesELResolver` in your JSF ---- - - [[jsf-facescontextutils]] === Using `FacesContextUtils` @@ -154,8 +147,6 @@ The following example shows how to use `FacesContextUtils`: ---- - - [[struts]] == Apache Struts @@ -170,8 +161,6 @@ as well as the Struts-provided https://struts.apache.org/plugins/spring/[Spring Plugin] for built-in Spring integration. - - [[tapestry]] == Apache Tapestry @@ -186,8 +175,6 @@ For more information, see Tapestry's dedicated https://tapestry.apache.org/integrating-with-spring-framework.html[integration module for Spring]. - - [[web-integration-resources]] == Further Resources diff --git a/framework-docs/modules/ROOT/pages/web/webflux-cors.adoc b/framework-docs/modules/ROOT/pages/web/webflux-cors.adoc index 5553837d8a0..bebcc0ace77 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-cors.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-cors.adoc @@ -7,8 +7,6 @@ Spring WebFlux lets you handle CORS (Cross-Origin Resource Sharing). This sectio describes how to do so. - - [[webflux-cors-intro]] == Introduction [.small]#xref:web/webmvc-cors.adoc#mvc-cors-intro[See equivalent in the Servlet stack]# @@ -24,8 +22,6 @@ what kind of cross-domain requests are authorized, rather than using less secure powerful workarounds based on IFRAME or JSONP. - - [[webflux-cors-processing]] == Processing [.small]#xref:web/webmvc-cors.adoc#mvc-cors-processing[See equivalent in the Servlet stack]# @@ -74,8 +70,6 @@ To learn more from the source or to make advanced customizations, see: ==== - - [[webflux-cors-credentialed-requests]] == Credentialed Requests [.small]#xref:web/webmvc-cors.adoc#mvc-cors-credentialed-requests[See equivalent in the Servlet stack]# @@ -103,8 +97,6 @@ WARNING: While such wildcard configuration can be handy, it is recommended when a finite set of values instead to provide a higher level of security. - - [[webflux-cors-controller]] == `@CrossOrigin` [.small]#xref:web/webmvc-cors.adoc#mvc-cors-controller[See equivalent in the Servlet stack]# @@ -280,8 +272,6 @@ Kotlin:: ====== -- - - [[webflux-cors-global]] == Global Configuration [.small]#xref:web/webmvc-cors.adoc#mvc-cors-global[See equivalent in the Servlet stack]# @@ -357,8 +347,6 @@ Kotlin:: ====== - - [[webflux-cors-webfilter]] == CORS `WebFilter` [.small]#xref:web/webmvc-cors.adoc#mvc-cors-filter[See equivalent in the Servlet stack]# diff --git a/framework-docs/modules/ROOT/pages/web/webflux-functional.adoc b/framework-docs/modules/ROOT/pages/web/webflux-functional.adoc index f0aaea966b5..882cb422e39 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-functional.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-functional.adoc @@ -9,8 +9,6 @@ It is an alternative to the annotation-based programming model but otherwise run the same xref:web/webflux/reactive-spring.adoc[Reactive Core] foundation. - - [[webflux-fn-overview]] == Overview [.small]#xref:web/webmvc-functional.adoc#webmvc-fn-overview[See equivalent in the Servlet stack]# @@ -115,8 +113,6 @@ through one of the built-in xref:web/webflux/reactive-spring.adoc#webflux-httpha Most applications can run through the WebFlux Java configuration, see xref:web/webflux-functional.adoc#webflux-fn-running[Running a Server]. - - [[webflux-fn-handler-functions]] == HandlerFunction [.small]#xref:web/webmvc-functional.adoc#webmvc-fn-handler-functions[See equivalent in the Servlet stack]# @@ -129,8 +125,6 @@ The request body is represented with a Reactor `Flux` or `Mono`. The response body is represented with any Reactive Streams `Publisher`, including `Flux` and `Mono`. For more on that, see xref:web-reactive.adoc#webflux-reactive-libraries[Reactive Libraries]. - - [[webflux-fn-request]] === ServerRequest @@ -370,7 +364,6 @@ ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView::cla ---- ====== - [[webflux-fn-handler-classes]] === Handler Classes @@ -484,7 +477,6 @@ found. If it is not found, we return a 404 Not Found response. ====== -- - [[webflux-fn-handler-validation]] === Validation @@ -558,7 +550,6 @@ a global `Validator` instance based on `LocalValidatorFactoryBean`. See xref:core/validation/beanvalidation.adoc[Spring Validation]. - [[webflux-fn-router-functions]] == `RouterFunction` [.small]#xref:web/webmvc-functional.adoc#webmvc-fn-router-functions[See equivalent in the Servlet stack]# @@ -573,14 +564,14 @@ to create a router. Generally, it is recommended to use the `route()` builder, as it provides convenient short-cuts for typical mapping scenarios without requiring hard-to-discover static imports. -For instance, the router function builder offers the method `GET(String, HandlerFunction)` to create a mapping for GET requests; and `POST(String, HandlerFunction)` for POSTs. +For instance, the router function builder offers the method `GET(String, HandlerFunction)` +to create a mapping for GET requests; and `POST(String, HandlerFunction)` for POSTs. Besides HTTP method-based mapping, the route builder offers a way to introduce additional predicates when mapping to requests. For each HTTP method there is an overloaded variant that takes a `RequestPredicate` as a parameter, though which additional constraints can be expressed. - [[webflux-fn-predicates]] === Predicates @@ -624,8 +615,6 @@ and `RequestPredicates.path(String)`. The example shown above also uses two request predicates, as the builder uses `RequestPredicates.GET` internally, and composes that with the `accept` predicate. - - [[webflux-fn-routes]] === Routes @@ -704,7 +693,6 @@ Kotlin:: <4> `otherRoute` is a router function that is created elsewhere, and added to the route built. ====== - [[nested-routes]] === Nested Routes @@ -960,8 +948,6 @@ Kotlin:: ====== - - [[webflux-fn-handler-filter-function]] == Filtering Handler Functions [.small]#xref:web/webmvc-functional.adoc#webmvc-fn-handler-filter-function[See equivalent in the Servlet stack]# diff --git a/framework-docs/modules/ROOT/pages/web/webflux-http-interface-client.adoc b/framework-docs/modules/ROOT/pages/web/webflux-http-interface-client.adoc index 871667acaaa..890478d79bb 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-http-interface-client.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-http-interface-client.adoc @@ -7,4 +7,3 @@ performs the exchanges. This helps to simplify HTTP remote access and provides a flexibility for to choose an API style such as synchronous or reactive. See xref:integration/rest-clients.adoc#rest-http-interface[REST Endpoints] for details. - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-test.adoc b/framework-docs/modules/ROOT/pages/web/webflux-test.adoc index ed93058dac2..39bd3906e87 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-test.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-test.adoc @@ -9,4 +9,4 @@ discussion of mock objects. xref:testing/webtestclient.adoc[`WebTestClient`] builds on these mock request and response objects to provide support for testing WebFlux applications without an HTTP -server. You can use the `WebTestClient` for end-to-end integration tests, too. \ No newline at end of file +server. You can use the `WebTestClient` for end-to-end integration tests, too. diff --git a/framework-docs/modules/ROOT/pages/web/webflux-view.adoc b/framework-docs/modules/ROOT/pages/web/webflux-view.adoc index d7c780ea27f..2236ce36182 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-view.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-view.adoc @@ -16,8 +16,6 @@ such, we do not recommend use the Spring WebFlux template support in application the templates are editable by external sources, since this can have security implications. - - [[webflux-view-thymeleaf]] == Thymeleaf [.small]#xref:web/webmvc-view/mvc-thymeleaf.adoc[See equivalent in the Servlet stack]# @@ -37,8 +35,6 @@ https://www.thymeleaf.org/documentation.html[Thymeleaf+Spring] and the WebFlux i https://web.archive.org/web/20210623051330/http%3A//forum.thymeleaf.org/Thymeleaf-3-0-8-JUST-PUBLISHED-td4030687.html[announcement]. - - [[webflux-view-freemarker]] == FreeMarker [.small]#xref:web/webmvc-view/mvc-freemarker.adoc[See equivalent in the Servlet stack]# @@ -47,8 +43,6 @@ https://freemarker.apache.org/[Apache FreeMarker] is a template engine for gener kind of text output from HTML to email and others. The Spring Framework has built-in integration for using Spring WebFlux with FreeMarker templates. - - [[webflux-view-freemarker-contextconfig]] === View Configuration [.small]#xref:web/webmvc-view/mvc-freemarker.adoc#mvc-view-freemarker-contextconfig[See equivalent in the Servlet stack]# @@ -108,8 +102,6 @@ shown in the preceding example. Given the preceding configuration, if your contr returns the view name, `welcome`, the resolver looks for the `classpath:/templates/freemarker/welcome.ftl` template. - - [[webflux-views-freemarker]] === FreeMarker Configuration [.small]#xref:web/webmvc-view/mvc-freemarker.adoc#mvc-views-freemarker[See equivalent in the Servlet stack]# @@ -167,8 +159,6 @@ Kotlin:: See the FreeMarker documentation for details of settings and variables as they apply to the `Configuration` object. - - [[webflux-view-freemarker-forms]] === Form Handling [.small]#xref:web/webmvc-view/mvc-freemarker.adoc#mvc-view-freemarker-forms[See equivalent in the Servlet stack]# @@ -179,7 +169,6 @@ form-backing objects and show the results of failed validations from a `Validato web or business tier. Spring also has support for the same functionality in FreeMarker, with additional convenience macros for generating form input elements themselves. - [[webflux-view-bind-macros]] ==== The Bind Macros [.small]#xref:web/webmvc-view/mvc-freemarker.adoc#mvc-view-bind-macros[See equivalent in the Servlet stack]# @@ -197,7 +186,6 @@ directly, the file is called `spring.ftl` and is in the For additional details on binding support, see xref:web/webmvc-view/mvc-freemarker.adoc#mvc-view-simple-binding[Simple Binding] for Spring MVC. - [[webflux-views-form-macros]] ==== Form Macros @@ -210,7 +198,6 @@ sections of the Spring MVC documentation. * xref:web/webmvc-view/mvc-freemarker.adoc#mvc-views-form-macros-html-escaping[HTML Escaping] - [[webflux-view-script]] == Script Views [.small]#xref:web/webmvc-view/mvc-script.adoc[See equivalent in the Servlet stack]# @@ -235,8 +222,6 @@ The following table shows the templating libraries that we have tested on differ TIP: The basic rule for integrating any other script engine is that it must implement the `ScriptEngine` and `Invocable` interfaces. - - [[webflux-view-script-dependencies]] === Requirements [.small]#xref:web/webmvc-view/mvc-script.adoc#mvc-view-script-dependencies[See equivalent in the Servlet stack]# @@ -255,8 +240,6 @@ Java 8+. Using the latest update release available is highly recommended. You need to have the script templating library. One way to do that for JavaScript is through https://www.webjars.org/[WebJars]. - - [[webflux-view-script-integrate]] === Script Templates [.small]#xref:web/webmvc-view/mvc-script.adoc#mvc-view-script-integrate[See equivalent in the Servlet stack]# @@ -417,8 +400,6 @@ Check out the Spring Framework unit tests, for more configuration examples. - - [[webflux-view-fragments]] == HTML Fragment [.small]#xref:web/webmvc-view/mvc-fragments.adoc[See equivalent in the Servlet stack]# @@ -492,22 +473,20 @@ It is also possible to return `Flux` directly without the `FragmentsRe wrapper. - - [[webflux-view-httpmessagewriter]] == JSON and XML [.small]#xref:web/webmvc-view/mvc-jackson.adoc[See equivalent in the Servlet stack]# -For xref:web/webflux/dispatcher-handler.adoc#webflux-multiple-representations[Content Negotiation] purposes, it is useful to be able to alternate -between rendering a model with an HTML template or as other formats (such as JSON or XML), -depending on the content type requested by the client. To support doing so, Spring WebFlux -provides the `HttpMessageWriterView`, which you can use to plug in any of the available -xref:web/webflux/reactive-spring.adoc#webflux-codecs[Codecs] from `spring-web`, such as `Jackson2JsonEncoder`, `Jackson2SmileEncoder`, -or `Jaxb2XmlEncoder`. +For xref:web/webflux/dispatcher-handler.adoc#webflux-multiple-representations[Content Negotiation] +purposes, it is useful to be able to alternate between rendering a model with an HTML template +or as other formats (such as JSON or XML), depending on the content type requested by the client. +To support doing so, Spring WebFlux provides the `HttpMessageWriterView`, which you can use to +plug in any of the available xref:web/webflux/reactive-spring.adoc#webflux-codecs[Codecs] from +`spring-web`, such as `Jackson2JsonEncoder`, `Jackson2SmileEncoder`, or `Jaxb2XmlEncoder`. -Unlike other view technologies, `HttpMessageWriterView` does not require a `ViewResolver` -but is instead xref:web/webflux/config.adoc#webflux-config-view-resolvers[configured] as a default view. You can -configure one or more such default views, wrapping different `HttpMessageWriter` instances +Unlike other view technologies, `HttpMessageWriterView` does not require a `ViewResolver` but is +instead xref:web/webflux/config.adoc#webflux-config-view-resolvers[configured] as a default view. +You can configure one or more such default views, wrapping different `HttpMessageWriter` instances or `Encoder` instances. The one that matches the requested content type is used at runtime. In most cases, a model contains multiple attributes. To determine which one to serialize, diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient.adoc index 448ff3db92d..01e2cb144a5 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient.adoc @@ -17,7 +17,3 @@ support for the following: * https://github.com/jetty-project/jetty-reactive-httpclient[Jetty Reactive HttpClient] * https://hc.apache.org/index.html[Apache HttpComponents] * Others can be plugged via `ClientHttpConnector`. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-attributes.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-attributes.adoc index df6e89419a6..f91ed00d9c6 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-attributes.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-attributes.adoc @@ -48,5 +48,3 @@ Note that you can configure a `defaultRequest` callback globally at the `WebClient.Builder` level which lets you insert attributes into all requests, which could be used for example in a Spring MVC application to populate request attributes based on `ThreadLocal` data. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-body.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-body.adoc index 7ff92ff268d..068b40869db 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-body.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-body.adoc @@ -103,7 +103,6 @@ Kotlin:: ====== - [[webflux-client-body-form]] == Form Data @@ -172,7 +171,6 @@ Kotlin:: ====== - [[webflux-client-body-multipart]] == Multipart Data @@ -340,6 +338,3 @@ Kotlin:: On the server side, `PartEvent` objects that are received via `@RequestBody` or `ServerRequest::bodyToFlux(PartEvent.class)` can be relayed to another service via the `WebClient`. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-builder.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-builder.adoc index d8ed1f3885f..b3368bc49ef 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-builder.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-builder.adoc @@ -78,6 +78,7 @@ Kotlin:: ---- ====== + [[webflux-client-builder-maxinmemorysize]] == MaxInMemorySize @@ -113,7 +114,6 @@ Kotlin:: ====== - [[webflux-client-builder-reactor]] == Reactor Netty @@ -144,7 +144,6 @@ Kotlin:: ---- ====== - [[webflux-client-builder-reactor-resources]] === Resources @@ -245,7 +244,6 @@ Kotlin:: ====== -- - [[webflux-client-builder-reactor-timeout]] === Timeouts @@ -378,7 +376,6 @@ Kotlin:: ====== - [[webflux-client-builder-jdk-httpclient]] == JDK HttpClient @@ -417,7 +414,6 @@ Kotlin:: ====== - [[webflux-client-builder-jetty]] == Jetty @@ -511,7 +507,6 @@ Kotlin:: -- - [[webflux-client-builder-http-components]] == HttpComponents @@ -543,5 +538,3 @@ Kotlin:: val webClient = WebClient.builder().clientConnector(connector).build() ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-context.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-context.adoc index eb2619849e4..c2b64314b2b 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-context.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-context.adoc @@ -32,6 +32,3 @@ Java:: .contextWrite(context -> context.put("foo", ...)); ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-exchange.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-exchange.adoc index fa14363330f..0fe359c64b4 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-exchange.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-exchange.adoc @@ -47,7 +47,3 @@ When using the above, after the returned `Mono` or `Flux` completes, the respons is checked and if not consumed it is released to prevent memory and connection leaks. Therefore the response cannot be decoded further downstream. It is up to the provided function to declare how to decode the response if needed. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-retrieve.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-retrieve.adoc index 256b8cc934c..da9d991e47c 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-retrieve.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-retrieve.adoc @@ -114,7 +114,3 @@ Kotlin:: .awaitBody() ---- ====== - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-synchronous.adoc b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-synchronous.adoc index dcc2ddc5ae0..b0174ed26c4 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-synchronous.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-webclient/client-synchronous.adoc @@ -91,7 +91,3 @@ Simply return the resulting reactive type from the controller method. The same p Kotlin Coroutines and Spring WebFlux, just use suspending function or return `Flow` in your controller method . ==== - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc b/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc index 04ea4fa3869..5c5dce2a3f9 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc @@ -8,6 +8,7 @@ messaging. include::partial$web/websocket-intro.adoc[leveloffset=+1] + [[webflux-websocket-server]] == WebSocket API [.small]#xref:web/websocket/stomp/server-config.adoc[See equivalent in the Servlet stack]# @@ -15,8 +16,6 @@ include::partial$web/websocket-intro.adoc[leveloffset=+1] The Spring Framework provides a WebSocket API that you can use to write client- and server-side applications that handle WebSocket messages. - - [[webflux-websocket-server-handler]] === Server [.small]#xref:web/websocket/server.adoc#websocket-server-handler[See equivalent in the Servlet stack]# @@ -135,8 +134,6 @@ Kotlin:: ---- ====== - - [[webflux-websockethandler]] === `WebSocketHandler` @@ -350,8 +347,6 @@ Kotlin:: <3> Join the streams and return a `Mono` that completes when either stream ends. ====== - - [[webflux-websocket-databuffer]] === `DataBuffer` @@ -365,9 +360,6 @@ When running on Netty, applications must use `DataBufferUtils.retain(dataBuffer) wish to hold on input data buffers in order to ensure they are not released, and subsequently use `DataBufferUtils.release(dataBuffer)` when the buffers are consumed. - - - [[webflux-websocket-server-handshake]] === Handshake [.small]#xref:web/websocket/server.adoc#websocket-server-handshake[See equivalent in the Servlet stack]# @@ -381,8 +373,6 @@ support for Reactor Netty, Tomcat, Jetty, and Undertow. setting a `Predicate` to extract attributes from the `WebSession` and insert them into the attributes of the `WebSocketSession`. - - [[webflux-websocket-server-config]] === Server Configuration [.small]#xref:web/websocket/server.adoc#websocket-server-runtime-configuration[See equivalent in the Servlet stack]# @@ -441,8 +431,6 @@ Kotlin:: Check the upgrade strategy for your server to see what options are available. Currently, only Tomcat and Jetty expose such options. - - [[webflux-websocket-server-cors]] === CORS [.small]#xref:web/websocket/server.adoc#websocket-server-allowed-origins[See equivalent in the Servlet stack]# @@ -454,8 +442,6 @@ that, you can also set the `corsConfigurations` property on the `SimpleUrlHandle specify CORS settings by URL pattern. If both are specified, they are combined by using the `combine` method on `CorsConfiguration`. - - [[webflux-websocket-client]] === Client diff --git a/framework-docs/modules/ROOT/pages/web/webflux.adoc b/framework-docs/modules/ROOT/pages/web/webflux.adoc index cbf487481cb..ffbe046f5bd 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux.adoc @@ -15,7 +15,3 @@ Both web frameworks mirror the names of their source modules {spring-framework-code}/spring-webflux[spring-webflux]) and co-exist side by side in the Spring Framework. Each module is optional. Applications can use one or the other module or, in some cases, both -- for example, Spring MVC controllers with the reactive `WebClient`. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc b/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc index c3481a3e5d1..5a66f3ddf50 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc @@ -22,7 +22,6 @@ xref:web/webflux/controller/ann-advice.adoc[@ControllerAdvice] that handles all and any `ErrorResponseException`, and renders an error response with a body. - [[webflux-ann-rest-exceptions-render]] == Render [.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-render[See equivalent in the Servlet stack]# @@ -49,7 +48,6 @@ xref:web/webflux/config.adoc[WebFlux Config] with a `WebFluxConfigurer`. Use tha any RFC 9457 response and take some action. - [[webflux-ann-rest-exceptions-non-standard]] == Non-Standard Fields [.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-non-standard[See equivalent in the Servlet stack]# @@ -69,7 +67,6 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro `ProblemDetail` of an exception into a subclass with the additional non-standard fields. - [[webflux-ann-rest-exceptions-i18n]] == Customization and i18n [.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-i18n[See equivalent in the Servlet stack]# @@ -149,8 +146,6 @@ xref:core/validation/beanvalidation.adoc#validation-beanvalidation-spring-method for more details. - - [[webflux-ann-rest-exceptions-client]] == Client Handling [.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-client[See equivalent in the Servlet stack]# @@ -159,7 +154,3 @@ A client application can catch `WebClientResponseException`, when using the `Web or `RestClientResponseException` when using the `RestTemplate`, and use their `getResponseBodyAs` methods to decode the error response body to any target type such as `ProblemDetail`, or a subclass of `ProblemDetail`. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/caching.adoc b/framework-docs/modules/ROOT/pages/web/webflux/caching.adoc index 6fe3f94de44..7c39b82f5cd 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/caching.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/caching.adoc @@ -14,7 +14,6 @@ the `Last-Modified` header. This section describes the HTTP caching related options available in Spring WebFlux. - [[webflux-caching-cachecontrol]] == `CacheControl` [.small]#xref:web/webmvc/mvc-caching.adoc#mvc-caching-cachecontrol[See equivalent in the Servlet stack]# @@ -67,7 +66,6 @@ Kotlin:: ====== - [[webflux-caching-etag-lastmodified]] == Controllers [.small]#xref:web/webmvc/mvc-caching.adoc#mvc-caching-etag-lastmodified[See equivalent in the Servlet stack]# @@ -178,11 +176,10 @@ values, or both. For conditional `GET` and `HEAD` requests, you can set the resp to 412 (PRECONDITION_FAILED) to prevent concurrent modification. - [[webflux-caching-static-resources]] == Static Resources [.small]#xref:web/webmvc/mvc-caching.adoc#mvc-caching-static-resources[See equivalent in the Servlet stack]# You should serve static resources with a `Cache-Control` and conditional response headers -for optimal performance. See the section on configuring xref:web/webflux/config.adoc#webflux-config-static-resources[Static Resources]. - +for optimal performance. See the section on configuring +xref:web/webflux/config.adoc#webflux-config-static-resources[Static Resources]. diff --git a/framework-docs/modules/ROOT/pages/web/webflux/config.adoc b/framework-docs/modules/ROOT/pages/web/webflux/config.adoc index 9d3e7fdeb79..fdded0b7481 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/config.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/config.adoc @@ -15,7 +15,6 @@ gain full control over the configuration through the xref:web/webflux/config.adoc#webflux-config-advanced-java[Advanced Configuration Mode]. - [[webflux-config-enable]] == Enabling WebFlux Config [.small]#xref:web/webmvc/mvc-config/enable.adoc[See equivalent in the Servlet stack]# @@ -54,7 +53,6 @@ xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[infrastructu available on the classpath -- for JSON, XML, and others. - [[webflux-config-customize]] == WebFlux config API [.small]#xref:web/webmvc/mvc-config/customize.adoc[See equivalent in the Servlet stack]# @@ -88,7 +86,6 @@ class WebConfig : WebFluxConfigurer { ====== - [[webflux-config-conversion]] == Conversion, formatting [.small]#xref:web/webmvc/mvc-config/conversion.adoc[See equivalent in the Servlet stack]# @@ -174,7 +171,6 @@ and the `FormattingConversionServiceFactoryBean` for more information on when to use `FormatterRegistrar` implementations. - [[webflux-config-validation]] == Validation [.small]#xref:web/webmvc/mvc-config/validation.adoc[See equivalent in the Servlet stack]# @@ -254,12 +250,10 @@ Kotlin:: ---- ====== - TIP: If you need to have a `LocalValidatorFactoryBean` injected somewhere, create a bean and mark it with `@Primary` in order to avoid conflict with the one declared in the MVC config. - [[webflux-config-content-negotiation]] == Content Type Resolvers [.small]#xref:web/webmvc/mvc-config/content-negotiation.adoc[See equivalent in the Servlet stack]# @@ -301,7 +295,6 @@ Kotlin:: ====== - [[webflux-config-message-codecs]] == HTTP message codecs [.small]#xref:web/webmvc/mvc-config/message-converters.adoc[See equivalent in the Servlet stack]# @@ -355,7 +348,6 @@ It also automatically registers the following well-known modules if they are det * {jackson-github-org}/jackson-module-kotlin[`jackson-module-kotlin`]: Support for Kotlin classes and data classes. - [[webflux-config-view-resolvers]] == View Resolvers [.small]#xref:web/webmvc/mvc-config/view-resolvers.adoc[See equivalent in the Servlet stack]# @@ -528,7 +520,6 @@ Kotlin:: See xref:web/webflux-view.adoc[View Technologies] for more on the view technologies that are integrated with Spring WebFlux. - [[webflux-config-static-resources]] == Static Resources [.small]#xref:web/webmvc/mvc-config/static-resources.adoc[See equivalent in the Servlet stack]# @@ -660,7 +651,6 @@ TIP: The Java configuration based on `ResourceHandlerRegistry` provides further for fine-grained control, for example, last-modified behavior and optimized resource resolution. - [[webflux-config-path-matching]] == Path Matching [.small]#xref:web/webmvc/mvc-config/path-matching.adoc[See equivalent in the Servlet stack]# @@ -685,8 +675,6 @@ reliance on it. ==== - - [[webflux-config-blocking-execution]] == Blocking Execution @@ -735,8 +723,6 @@ By default, controller methods whose return type is not recognized by the config method predicate via `BlockingExecutionConfigurer`. - - [[webflux-config-websocket-service]] == WebSocketService @@ -786,8 +772,6 @@ Kotlin:: ====== - - [[webflux-config-advanced-java]] == Advanced Configuration Mode [.small]#xref:web/webmvc/mvc-config/advanced-java.adoc[See equivalent in the Servlet stack]# @@ -830,7 +814,3 @@ Kotlin:: You can keep existing methods in `WebConfig`, but you can now also override bean declarations from the base class and still have any number of other `WebMvcConfigurer` implementations on the classpath. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller.adoc index 14bbd826820..3fa3597c1b2 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller.adoc @@ -40,6 +40,3 @@ Kotlin:: ====== In the preceding example, the method returns a `String` to be written to the response body. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-advice.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-advice.adoc index 7f6f64be350..9308584d402 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-advice.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-advice.adoc @@ -66,4 +66,3 @@ The selectors in the preceding example are evaluated at runtime and may negative performance if used extensively. See the {spring-framework-api}/web/bind/annotation/ControllerAdvice.html[`@ControllerAdvice`] javadoc for more details. - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-exceptions.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-exceptions.adoc index a4435e11d5f..5c20f2b25b6 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-exceptions.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-exceptions.adoc @@ -7,10 +7,8 @@ `@ExceptionHandler` methods to handle exceptions from controller methods. The following example includes such a handler method: - include-code::./SimpleController[indent=0] - The exception can match against a top-level exception being propagated (that is, a direct `IOException` being thrown) or against the immediate cause within a top-level wrapper exception (for example, an `IOException` wrapped inside an `IllegalStateException`). @@ -30,6 +28,7 @@ Support for `@ExceptionHandler` methods in Spring WebFlux is provided by the `HandlerAdapter` for `@RequestMapping` methods. See xref:web/webflux/dispatcher-handler.adoc[`DispatcherHandler`] for more detail. + [[webflux-ann-exceptionhandler-media]] == Media Type Mapping [.small]#xref:web/webmvc/mvc-controller/ann-exceptionhandler.adoc#mvc-ann-exceptionhandler-media[See equivalent in the Servlet stack]# @@ -39,7 +38,6 @@ This allows to refine error responses depending on the media types requested by Applications can declare producible media types directly on annotations, for the same exception type: - include-code::./MediaTypeController[tag=mediatype,indent=0] Here, methods handle the same exception type but will not be rejected as duplicates. @@ -56,13 +54,9 @@ the content negotiation during the error handling phase will decide which conten as `@RequestMapping` methods, except the request body might have been consumed already. - [[webflux-ann-exceptionhandler-return-values]] == Return Values [.small]#xref:web/webmvc/mvc-controller/ann-exceptionhandler.adoc#mvc-ann-exceptionhandler-return-values[See equivalent in the Servlet stack]# `@ExceptionHandler` methods support the same xref:web/webflux/controller/ann-methods/return-types.adoc[return values] as `@RequestMapping` methods. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-initbinder.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-initbinder.adoc index d093ba9e3de..e2a555fa8c5 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-initbinder.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-initbinder.adoc @@ -111,4 +111,3 @@ Kotlin:: [.small]#xref:web/webmvc/mvc-controller/ann-initbinder.adoc#mvc-ann-initbinder-model-design[See equivalent in the Servlet stack]# include::partial$web/web-data-binding-model-design.adoc[] - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods.adoc index 6930c9dbda1..bfa7019959b 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods.adoc @@ -6,5 +6,3 @@ `@RequestMapping` handler methods have a flexible signature and can choose from a range of supported controller method arguments and return values. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/arguments.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/arguments.adoc index 37d297afe3b..1f72ee3b82e 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/arguments.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/arguments.adoc @@ -117,5 +117,3 @@ and others) and is equivalent to `required=false`. {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty], or as a `@ModelAttribute`, otherwise. |=== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/cookievalue.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/cookievalue.adoc index 49074543f08..9c4c0aadb0a 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/cookievalue.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/cookievalue.adoc @@ -43,5 +43,3 @@ Kotlin:: Type conversion is applied automatically if the target method parameter type is not `String`. See xref:web/webflux/controller/ann-methods/typeconversion.adoc[Type Conversion]. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/httpentity.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/httpentity.adoc index 5711095c070..d7be35bc122 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/httpentity.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/httpentity.adoc @@ -29,5 +29,3 @@ Kotlin:: } ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/jackson.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/jackson.adoc index 9573aadfaa1..a5e1d90b633 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/jackson.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/jackson.adoc @@ -3,6 +3,7 @@ Spring offers support for the Jackson JSON library. + [[webflux-ann-jsonview]] == JSON Views [.small]#xref:web/webmvc/mvc-controller/ann-methods/jackson.adoc[See equivalent in the Servlet stack]# @@ -83,6 +84,3 @@ Kotlin:: NOTE: `@JsonView` allows an array of view classes but you can specify only one per controller method. Use a composite interface if you need to activate multiple views. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/matrix-variables.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/matrix-variables.adoc index 805bbe54753..b68c9f200dd 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/matrix-variables.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/matrix-variables.adoc @@ -156,5 +156,3 @@ Kotlin:: } ---- ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/multipart-forms.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/multipart-forms.adoc index ab6c1f647ec..9e5ac96d7ab 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/multipart-forms.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/multipart-forms.adoc @@ -210,6 +210,7 @@ Kotlin:: ====== -- + [[partevent]] == `PartEvent` diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestattrib.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestattrib.adoc index 4fc08067bfb..5d473629fd6 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestattrib.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestattrib.adoc @@ -31,5 +31,3 @@ Kotlin:: ---- <1> Using `@RequestAttribute`. ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestbody.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestbody.adoc index 90d1ea2c83a..d6c38521aa5 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestbody.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestbody.adoc @@ -118,4 +118,3 @@ Kotlin:: If method validation applies because other parameters have `@Constraint` annotations, then `HandlerMethodValidationException` is raised instead. For more details, see the section on xref:web/webflux/controller/ann-validation.adoc[Validation]. - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestheader.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestheader.adoc index 64c3fa9a7a9..fa6304c61c6 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestheader.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestheader.adoc @@ -63,5 +63,3 @@ TIP: Built-in support is available for converting a comma-separated string into array or collection of strings or other types known to the type conversion system. For example, a method parameter annotated with `@RequestHeader("Accept")` may be of type `String` but also of `String[]` or `List`. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestparam.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestparam.adoc index 0066245d26c..7b23c4aa825 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestparam.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/requestparam.adoc @@ -77,5 +77,3 @@ default, any argument that is a simple value type (as determined by {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty]) and is not resolved by any other argument resolver is treated as if it were annotated with `@RequestParam`. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responsebody.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responsebody.adoc index d0d34f8d2e2..8df9620441d 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responsebody.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responsebody.adoc @@ -38,13 +38,12 @@ than a meta-annotation marked with `@Controller` and `@ResponseBody`. `@ResponseBody` supports reactive types, which means you can return Reactor or RxJava types and have the asynchronous values they produce rendered to the response. -For additional details, see xref:web/webflux/reactive-spring.adoc#webflux-codecs-streaming[Streaming] and -xref:web/webflux/reactive-spring.adoc#webflux-codecs-jackson[JSON rendering]. +For additional details, see xref:web/webflux/reactive-spring.adoc#webflux-codecs-streaming[Streaming] +and xref:web/webflux/reactive-spring.adoc#webflux-codecs-jackson[JSON rendering]. You can combine `@ResponseBody` methods with JSON serialization views. See xref:web/webflux/controller/ann-methods/jackson.adoc[Jackson JSON] for details. -You can use the xref:web/webflux/config.adoc#webflux-config-message-codecs[HTTP message codecs] option of the xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config] to -configure or customize message writing. - - +You can use the xref:web/webflux/config.adoc#webflux-config-message-codecs[HTTP message codecs] +option of the xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config] +to configure or customize message writing. diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responseentity.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responseentity.adoc index 21766d33846..6831075da2a 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responseentity.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/responseentity.adoc @@ -3,7 +3,8 @@ [.small]#xref:web/webmvc/mvc-controller/ann-methods/responseentity.adoc[See equivalent in the Servlet stack]# -`ResponseEntity` is like xref:web/webflux/controller/ann-methods/responsebody.adoc[`@ResponseBody`] but with status and headers. For example: +`ResponseEntity` is like xref:web/webflux/controller/ann-methods/responsebody.adoc[`@ResponseBody`] +but with status and headers. For example: [tabs] ====== @@ -45,5 +46,3 @@ for the body. This allows a variety of async responses with `ResponseEntity` as * `Mono>>` or `Mono>>` are yet another possible, albeit less common alternative. They provide the response status and headers asynchronously first and then the response body, also asynchronously, second. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc index 450b9e99258..f859c50e4de 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc @@ -13,10 +13,11 @@ is not efficient. If the media type implies an infinite stream (for example, `application/json+stream`), values are written and flushed individually. Otherwise, values are written individually and the flushing happens separately. -NOTE: If an error happens while an element is encoded to JSON, the response might have been written to and committed already -and it is impossible at that point to render a proper error response. -In some cases, applications can choose to trade memory efficiency for better handling such errors by buffering elements and encoding them all at once. -Controllers can then return a `Flux>`; Reactor provides a dedicated operator for that, `Flux#collectList()`. +NOTE: If an error happens while an element is encoded to JSON, the response might have been written to +and committed already and it is impossible at that point to render a proper error response. +In some cases, applications can choose to trade memory efficiency for better handling such errors by +buffering elements and encoding them all at once. Controllers can then return a `Flux>`; +Reactor provides a dedicated operator for that, `Flux#collectList()`. [cols="1,2", options="header"] |=== @@ -89,5 +90,3 @@ Controllers can then return a `Flux>`; Reactor provides a dedicated oper {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty], in which case it remains unresolved. |=== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattribute.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattribute.adoc index 4469d226435..a3df7ee634d 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattribute.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattribute.adoc @@ -38,5 +38,3 @@ For use cases that require adding or removing session attributes, consider injec For temporary storage of model attributes in the session as part of a controller workflow, consider using `SessionAttributes`, as described in xref:web/webflux/controller/ann-methods/sessionattributes.adoc[`@SessionAttributes`]. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattributes.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattributes.adoc index 7bc918c846f..5dd729b04fb 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattributes.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/sessionattributes.adoc @@ -92,5 +92,3 @@ Kotlin:: <1> Using the `@SessionAttributes` annotation. <2> Using a `SessionStatus` variable. ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/typeconversion.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/typeconversion.adoc index ca61ec37c5c..d81513a425b 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/typeconversion.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/typeconversion.adoc @@ -10,13 +10,12 @@ can require type conversion if the argument is declared as something other than For such cases, type conversion is automatically applied based on the configured converters. By default, simple types (such as `int`, `long`, `Date`, and others) are supported. Type conversion -can be customized through a `WebDataBinder` (see xref:web/webflux/controller/ann-initbinder.adoc[`DataBinder`]) or by registering -`Formatters` with the `FormattingConversionService` (see xref:core/validation/format.adoc[Spring Field Formatting]). +can be customized through a `WebDataBinder` (see xref:web/webflux/controller/ann-initbinder.adoc[`DataBinder`]) +or by registering `Formatters` with the `FormattingConversionService` (see +xref:core/validation/format.adoc[Spring Field Formatting]). A practical issue in type conversion is the treatment of an empty String source value. Such a value is treated as missing if it becomes `null` as a result of type conversion. This can be the case for `Long`, `UUID`, and other target types. If you want to allow `null` to be injected, either use the `required` flag on the argument annotation, or declare the argument as `@Nullable`. - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-modelattrib-methods.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-modelattrib-methods.adoc index f4a61101059..fd9b033ef8d 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-modelattrib-methods.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-modelattrib-methods.adoc @@ -5,9 +5,9 @@ You can use the `@ModelAttribute` annotation: -* On a xref:web/webflux/controller/ann-methods/modelattrib-method-args.adoc[method argument] in `@RequestMapping` methods -to create or access an Object from the model and to bind it to the request through a -`WebDataBinder`. +* On a xref:web/webflux/controller/ann-methods/modelattrib-method-args.adoc[method argument] +in `@RequestMapping` methods to create or access an Object from the model and to bind it +to the request through a `WebDataBinder`. * As a method-level annotation in `@Controller` or `@ControllerAdvice` classes, helping to initialize the model prior to any `@RequestMapping` method invocation. * On a `@RequestMapping` method to mark its return value as a model attribute. @@ -159,6 +159,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc index ba618c0c8d8..8230b453bbe 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc @@ -5,6 +5,7 @@ This section discusses request mapping for annotated controllers. + [[webflux-ann-requestmapping-annotation]] == `@RequestMapping` @@ -408,7 +409,6 @@ Kotlin:: ====== - [[webflux-ann-requestmapping-head-options]] == HTTP HEAD, OPTIONS [.small]#xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-head-options[See equivalent in the Servlet stack]# @@ -518,7 +518,6 @@ Kotlin:: ====== - [[webflux-ann-httpexchange-annotation]] == `@HttpExchange` [.small]#xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-httpexchange-annotation[See equivalent in the Servlet stack]# @@ -605,4 +604,4 @@ For method parameters and returns values, generally, `@HttpExchange` supports a subset of the method parameters that `@RequestMapping` does. Notably, it excludes any server-side specific parameter types. For details, see the list for xref:integration/rest-clients.adoc#rest-http-interface-method-parameters[@HttpExchange] and -xref:web/webflux/controller/ann-methods/arguments.adoc[@RequestMapping]. \ No newline at end of file +xref:web/webflux/controller/ann-methods/arguments.adoc[@RequestMapping]. diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann.adoc index 00241404fca..2c4427d09e0 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann.adoc @@ -47,7 +47,6 @@ every method inherits the type-level `@ResponseBody` annotation and, therefore, directly to the response body versus view resolution and rendering with an HTML template. - [[webflux-ann-requestmapping-proxying]] == AOP Proxies [.small]#xref:web/webmvc/mvc-controller/ann.adoc#mvc-ann-requestmapping-proxying[See equivalent in the Servlet stack]# @@ -67,7 +66,3 @@ NOTE: Keep in mind that as of 6.0, with interface proxying, Spring WebFlux no lo controllers based solely on a type-level `@RequestMapping` annotation on the interface. Please, enable class based proxying, or otherwise the interface must also have an `@Controller` annotation. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/dispatcher-handler.adoc b/framework-docs/modules/ROOT/pages/web/webflux/dispatcher-handler.adoc index 8a17248f5ee..cb3bcaa26bf 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/dispatcher-handler.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/dispatcher-handler.adoc @@ -13,7 +13,8 @@ It is also designed to be a Spring bean itself and implements `ApplicationContex for access to the context in which it runs. If `DispatcherHandler` is declared with a bean name of `webHandler`, it is, in turn, discovered by {spring-framework-api}/web/server/adapter/WebHttpHandlerBuilder.html[`WebHttpHandlerBuilder`], -which puts together a request-processing chain, as described in xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API]. +which puts together a request-processing chain, as described in +xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API]. Spring configuration in a WebFlux application typically contains: @@ -44,8 +45,8 @@ Kotlin:: ---- ====== -The resulting `HttpHandler` is ready for use with a xref:web/webflux/reactive-spring.adoc#webflux-httphandler[server adapter]. - +The resulting `HttpHandler` is ready for use with a +xref:web/webflux/reactive-spring.adoc#webflux-httphandler[server adapter]. [[webflux-special-bean-types]] @@ -59,7 +60,8 @@ you can customize their properties, extend them, or replace them. The following table lists the special beans detected by the `DispatcherHandler`. Note that there are also some other beans detected at a lower level (see -xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api-special-beans[Special bean types] in the Web Handler API). +xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api-special-beans[Special bean types] +in the Web Handler API). [[webflux-special-beans-table]] [cols="1,2", options="header"] @@ -89,22 +91,22 @@ xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api-special-beans[Spec |=== - [[webflux-framework-config]] == WebFlux Config [.small]#xref:web/webmvc/mvc-servlet/config.adoc[See equivalent in the Servlet stack]# Applications can declare the infrastructure beans (listed under xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api-special-beans[Web Handler API] and -xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[`DispatcherHandler`]) that are required to process requests. -However, in most cases, the xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config] is the best starting point. It declares the -required beans and provides a higher-level configuration callback API to customize it. +xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[`DispatcherHandler`]) +that are required to process requests. However, in most cases, the +xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config] +is the best starting point. It declares the required beans and provides a higher-level +configuration callback API to customize it. NOTE: Spring Boot relies on the WebFlux config to configure Spring WebFlux and also provides many extra convenient options. - [[webflux-dispatcher-handler-sequence]] == Processing [.small]#xref:web/webmvc/mvc-servlet/sequence.adoc[See equivalent in the Servlet stack]# @@ -118,14 +120,14 @@ exposes the return value from the execution as `HandlerResult`. processing by writing to the response directly or by using a view to render. - [[webflux-resulthandling]] == Result Handling The return value from the invocation of a handler, through a `HandlerAdapter`, is wrapped as a `HandlerResult`, along with some additional context, and passed to the first `HandlerResultHandler` that claims support for it. The following table shows the available -`HandlerResultHandler` implementations, all of which are declared in the xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config]: +`HandlerResultHandler` implementations, all of which are declared in the +xref:web/webflux/dispatcher-handler.adoc#webflux-framework-config[WebFlux Config]: [cols="1,2,1", options="header"] |=== @@ -155,7 +157,6 @@ as a `HandlerResult`, along with some additional context, and passed to the firs |=== - [[webflux-dispatcher-exceptions]] == Exceptions [.small]#xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[See equivalent in the Servlet stack]# @@ -176,20 +177,18 @@ See also xref:web/webflux/controller/ann-exceptions.adoc[Exceptions] in the "`An xref:web/webflux/reactive-spring.adoc#webflux-exception-handler[Exceptions] in the WebHandler API section. - [[webflux-viewresolution]] == View Resolution [.small]#xref:web/webmvc/mvc-servlet/viewresolver.adoc[See equivalent in the Servlet stack]# View resolution enables rendering to a browser with an HTML template and a model without tying you to a specific view technology. In Spring WebFlux, view resolution is -supported through a dedicated xref:web/webflux/dispatcher-handler.adoc#webflux-resulthandling[HandlerResultHandler] that uses -`ViewResolver` instances to map a String (representing a logical view name) to a `View` -instance. The `View` is then used to render the response. +supported through a dedicated xref:web/webflux/dispatcher-handler.adoc#webflux-resulthandling[HandlerResultHandler] +that uses `ViewResolver` instances to map a String (representing a logical view name) to +a `View` instance. The `View` is then used to render the response. Web applications need to use a xref:web/webflux-view.adoc[View rendering library] to support this use case. - [[webflux-viewresolution-handling]] === Handling [.small]#xref:web/webmvc/mvc-servlet/viewresolver.adoc#mvc-viewresolver-handling[See equivalent in the Servlet stack]# @@ -225,7 +224,6 @@ dedicated configuration API for view resolution. See xref:web/webflux-view.adoc[View Technologies] for more on the view technologies integrated with Spring WebFlux. - [[webflux-redirecting-redirect-prefix]] === Redirecting [.small]#xref:web/webmvc/mvc-servlet/viewresolver.adoc#mvc-redirecting-redirect-prefix[See equivalent in the Servlet stack]# @@ -243,7 +241,6 @@ operate in terms of logical view names. A view name such as NOTE: xref:web/webmvc/mvc-servlet/viewresolver.adoc#mvc-redirecting-forward-prefix[Unlike the Servlet stack], Spring WebFlux does not support "FORWARD" dispatches, so `forward:` prefixes are not supported as a result. - [[webflux-multiple-representations]] === Content Negotiation [.small]#xref:web/webmvc/mvc-servlet/viewresolver.adoc#mvc-multiple-representations[See equivalent in the Servlet stack]# @@ -257,7 +254,3 @@ In order to support media types such as JSON and XML, Spring WebFlux provides xref:web/webflux/reactive-spring.adoc#webflux-codecs[HttpMessageWriter]. Typically, you would configure these as default views through the xref:web/webflux/config.adoc#webflux-config-view-resolvers[WebFlux Configuration]. Default views are always selected and used if they match the requested media type. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/new-framework.adoc b/framework-docs/modules/ROOT/pages/web/webflux/new-framework.adoc index 9b7022fb72a..a6dfda38230 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/new-framework.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/new-framework.adoc @@ -20,7 +20,6 @@ composition of asynchronous logic. At the programming-model level, Java 8 enable WebFlux to offer functional web endpoints alongside annotated controllers. - [[webflux-why-reactive]] == Define "`Reactive`" @@ -53,7 +52,6 @@ The purpose of Reactive Streams is only to establish the mechanism and a boundar If a publisher cannot slow down, it has to decide whether to buffer, drop, or fail. - [[webflux-reactive-api]] == Reactive API @@ -86,27 +84,26 @@ xref:languages/kotlin/coroutines.adoc[Coroutines] APIs in Kotlin which provides The following Kotlin code samples will be provided with Coroutines APIs. - [[webflux-programming-models]] == Programming Models The `spring-web` module contains the reactive foundation that underlies Spring WebFlux, -including HTTP abstractions, Reactive Streams xref:web/webflux/reactive-spring.adoc#webflux-httphandler[adapters] for supported -servers, xref:web/webflux/reactive-spring.adoc#webflux-codecs[codecs], and a core xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] comparable to +including HTTP abstractions, Reactive Streams xref:web/webflux/reactive-spring.adoc#webflux-httphandler[adapters] +for supported servers, xref:web/webflux/reactive-spring.adoc#webflux-codecs[codecs], and a core +xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] comparable to the Servlet API but with non-blocking contracts. On that foundation, Spring WebFlux provides a choice of two programming models: -* xref:web/webflux/controller.adoc[Annotated Controllers]: Consistent with Spring MVC and based on the same annotations -from the `spring-web` module. Both Spring MVC and WebFlux controllers support reactive +* xref:web/webflux/controller.adoc[Annotated Controllers]: Consistent with Spring MVC and based on the +same annotations from the `spring-web` module. Both Spring MVC and WebFlux controllers support reactive (Reactor and RxJava) return types, and, as a result, it is not easy to tell them apart. One notable difference is that WebFlux also supports reactive `@RequestBody` arguments. -* xref:web/webflux-functional.adoc[Functional Endpoints]: Lambda-based, lightweight, and functional programming model. You can think of -this as a small library or a set of utilities that an application can use to route and -handle requests. The big difference with annotated controllers is that the application -is in charge of request handling from start to finish versus declaring intent through -annotations and being called back. - +* xref:web/webflux-functional.adoc[Functional Endpoints]: Lambda-based, lightweight, +and functional programming model. You can think of this as a small library or a set of +utilities that an application can use to route and handle requests. The big difference +with annotated controllers is that the application is in charge of request handling +from start to finish versus declaring intent through annotations and being called back. [[webflux-framework-choice]] @@ -164,7 +161,6 @@ unsure what benefits to look for, start by learning about how non-blocking I/O w (for example, concurrency on single-threaded Node.js) and its effects. - [[webflux-server-choice]] == Servers @@ -195,7 +191,6 @@ For the reasons listed above, mixing blocking I/O and non-blocking I/O in the sa For Undertow, Spring WebFlux uses Undertow APIs directly without the Servlet API. - [[webflux-performance]] == Performance @@ -212,7 +207,6 @@ That is where the reactive stack begins to show its strengths, and the differenc dramatic. - [[webflux-concurrency-model]] == Concurrency Model @@ -231,7 +225,6 @@ TIP: "`To scale`" and "`small number of threads`" may sound contradictory, but t current thread (and rely on callbacks instead) means that you do not need extra threads, as there are no blocking calls to absorb. - [[invoking-a-blocking-api]] === Invoking a Blocking API @@ -283,7 +276,3 @@ you need to use server-specific configuration APIs, or, if you use Spring Boot, check the Spring Boot configuration options for each server. You can xref:web/webflux-webclient/client-builder.adoc[configure] the `WebClient` directly. For all other libraries, see their respective documentation. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/reactive-spring.adoc b/framework-docs/modules/ROOT/pages/web/webflux/reactive-spring.adoc index 9615631c6f2..c56ed3beeb9 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/reactive-spring.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/reactive-spring.adoc @@ -22,7 +22,6 @@ builds on this basic contract. deserialization of HTTP request and response content. - [[webflux-httphandler]] == `HttpHandler` @@ -218,11 +217,11 @@ in the WAR. That class wraps an `HttpHandler` with `ServletHttpHandlerAdapter` a that as a `Servlet`. - [[webflux-web-handler-api]] == `WebHandler` API -The `org.springframework.web.server` package builds on the xref:web/webflux/reactive-spring.adoc#webflux-httphandler[`HttpHandler`] contract +The `org.springframework.web.server` package builds on the +xref:web/webflux/reactive-spring.adoc#webflux-httphandler[`HttpHandler`] contract to provide a general-purpose web API for processing requests through a chain of multiple {spring-framework-api}/web/server/WebExceptionHandler.html[`WebExceptionHandler`], multiple {spring-framework-api}/web/server/WebFilter.html[`WebFilter`], and a single @@ -363,15 +362,12 @@ to individual parts by name and, hence, requires parsing multipart data in full. By contrast, you can use `@RequestBody` to decode the content to `Flux` without collecting to a `MultiValueMap`. - [[webflux-forwarded-headers]] === Forwarded Headers [.small]#xref:web/webmvc/filters.adoc#filters-forwarded-headers[See equivalent in the Servlet stack]# include::partial$web/forwarded-headers.adoc[] - - [[webflux-forwarded-headers-transformer]] === ForwardedHeaderTransformer @@ -385,8 +381,6 @@ NOTE: In 5.1 `ForwardedHeaderFilter` was deprecated and superseded by exchange is created. If the filter is configured anyway, it is taken out of the list of filters, and `ForwardedHeaderTransformer` is used instead. - - [[webflux-forwarded-headers-security]] === Security Considerations @@ -397,7 +391,6 @@ from the outside. You can also configure the `ForwardedHeaderTransformer` with `removeOnly=true`, in which case it removes but does not use the headers. - [[webflux-filters]] == Filters [.small]#xref:web/webmvc/filters.adoc[See equivalent in the Servlet stack]# @@ -408,7 +401,6 @@ logic before and after the rest of the processing chain of filters and the targe as declaring it as a Spring bean and (optionally) expressing precedence by using `@Order` on the bean declaration or by implementing `Ordered`. - [[webflux-filters-cors]] === CORS [.small]#xref:web/webmvc/filters.adoc#filters-cors[See equivalent in the Servlet stack]# @@ -437,7 +429,6 @@ Here is how you can instantiate and configure a `UrlHandlerFilter` for a blog ap include-code::./UrlHandlerFilterConfiguration[tag=config,indent=0] - [[webflux-exception-handler]] == Exceptions [.small]#xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc#mvc-ann-customer-servlet-container-error-page[See equivalent in the Servlet stack]# @@ -468,7 +459,6 @@ The following table describes the available `WebExceptionHandler` implementation |=== - [[webflux-codecs]] == Codecs [.small]#xref:web/webmvc/message-converters.adoc#message-converters[See equivalent in the Servlet stack]# @@ -550,13 +540,13 @@ encode a `Mono>`. On the server side where form content often needs to be accessed from multiple places, `ServerWebExchange` provides a dedicated `getFormData()` method that parses the content through `FormHttpMessageReader` and then caches the result for repeated access. -See xref:web/webflux/reactive-spring.adoc#webflux-form-data[Form Data] in the xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] section. +See xref:web/webflux/reactive-spring.adoc#webflux-form-data[Form Data] in the +xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] section. Once `getFormData()` is used, the original raw content can no longer be read from the request body. For this reason, applications are expected to go through `ServerWebExchange` consistently for access to the cached form data versus reading from the raw request body. - [[webflux-codecs-multipart]] === Multipart @@ -572,14 +562,14 @@ For more information about the `DefaultPartHttpMessageReader`, refer to the On the server side where multipart form content may need to be accessed from multiple places, `ServerWebExchange` provides a dedicated `getMultipartData()` method that parses the content through `MultipartHttpMessageReader` and then caches the result for repeated access. -See xref:web/webflux/reactive-spring.adoc#webflux-multipart[Multipart Data] in the xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] section. +See xref:web/webflux/reactive-spring.adoc#webflux-multipart[Multipart Data] in the +xref:web/webflux/reactive-spring.adoc#webflux-web-handler-api[`WebHandler` API] section. Once `getMultipartData()` is used, the original raw content can no longer be read from the request body. For this reason applications have to consistently use `getMultipartData()` for repeated, map-like access to parts, or otherwise rely on the `SynchronossPartHttpMessageReader` for a one-time access to `Flux`. - [[webflux-codecs-protobuf]] === Protocol Buffers @@ -619,8 +609,6 @@ a `maxParts` property to limit the overall number of parts in a multipart reques To configure all three in WebFlux, you'll need to supply a pre-configured instance of `MultipartHttpMessageReader` to `ServerCodecConfigurer`. - - [[webflux-codecs-streaming]] === Streaming [.small]#xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-http-streaming[See equivalent in the Servlet stack]# @@ -631,7 +619,6 @@ reliably detect a disconnected client sooner rather than later. Such a send coul comment-only, empty SSE event or any other "no-op" data that would effectively serve as a heartbeat. - [[webflux-codecs-buffers]] === `DataBuffer` @@ -648,7 +635,6 @@ cases please review the information in xref:core/databuffer-codec.adoc[Data Buff especially the section on xref:core/databuffer-codec.adoc#databuffers-using[Using DataBuffer]. - [[webflux-logging]] == Logging [.small]#xref:web/webmvc/mvc-servlet/logging.adoc[See equivalent in the Servlet stack]# @@ -664,7 +650,6 @@ messages may show a different level of detail at `TRACE` vs `DEBUG`. Good logging comes from the experience of using the logs. If you spot anything that does not meet the stated goals, please let us know. - [[webflux-logging-id]] === Log Id @@ -680,7 +665,6 @@ while a fully formatted prefix based on that ID is available from ({spring-framework-api}/web/reactive/function/client/ClientRequest.html#LOG_ID_ATTRIBUTE[`LOG_ID_ATTRIBUTE`]) ,while a fully formatted prefix is available from `ClientRequest#logPrefix()`. - [[webflux-logging-sensitive-data]] === Sensitive Data [.small]#xref:web/webmvc/mvc-servlet/logging.adoc#mvc-logging-sensitive-data[See equivalent in the Servlet stack]# @@ -750,7 +734,6 @@ Kotlin:: ---- ====== - [[webflux-logging-appenders]] === Appenders @@ -759,8 +742,6 @@ blocking. While those have their own drawbacks such as potentially dropping mess that could not be queued for logging, they are the best available options currently for use in a reactive, non-blocking application. - - [[webflux-codecs-custom]] === Custom codecs @@ -800,4 +781,3 @@ Kotlin:: .build() ---- ====== - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/security.adoc b/framework-docs/modules/ROOT/pages/web/webflux/security.adoc index fcb982d254c..6e1d056e5cd 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/security.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/security.adoc @@ -12,7 +12,3 @@ reference documentation, including: * {docs-spring-security}/reactive/test/index.html[WebFlux Testing Support] * {docs-spring-security}/features/exploits/csrf.html#csrf-protection[CSRF protection] * {docs-spring-security}/features/exploits/headers.html[Security Response Headers] - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webflux/uri-building.adoc b/framework-docs/modules/ROOT/pages/web/webflux/uri-building.adoc index 8ca87a11f34..1ab092df740 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/uri-building.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/uri-building.adoc @@ -7,5 +7,3 @@ This section describes various options available in the Spring Framework to prepare URIs. include::partial$web/web-uris.adoc[leveloffset=+1] - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-client.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-client.adoc index 1f73f66f3ec..17bd4bcd567 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-client.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-client.adoc @@ -4,8 +4,6 @@ This section describes options for client-side access to REST endpoints. - - [[webmvc-restclient]] == `RestClient` @@ -14,8 +12,6 @@ This section describes options for client-side access to REST endpoints. See xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] for more details. - - [[webmvc-webclient]] == `WebClient` @@ -24,8 +20,6 @@ See xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] for more de See xref:web/webflux-webclient.adoc[WebClient] for more details. - - [[webmvc-resttemplate]] == `RestTemplate` @@ -35,6 +29,7 @@ libraries. See xref:integration/rest-clients.adoc[REST Endpoints] for details. + [[webmvc-http-interface]] == HTTP Interface diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-cors.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-cors.adoc index 032311bff3d..e5e0dd50c9c 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-cors.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-cors.adoc @@ -7,8 +7,6 @@ Spring MVC lets you handle CORS (Cross-Origin Resource Sharing). This section describes how to do so. - - [[mvc-cors-intro]] == Introduction [.small]#xref:web/webflux-cors.adoc#webflux-cors-intro[See equivalent in the Reactive stack]# @@ -24,8 +22,6 @@ what kind of cross-domain requests are authorized, rather than using less secure powerful workarounds based on IFRAME or JSONP. - - [[mvc-cors-credentialed-requests]] == Credentialed Requests [.small]#xref:web/webflux-cors.adoc#webflux-cors-credentialed-requests[See equivalent in the Reactive stack]# @@ -53,8 +49,6 @@ WARNING: While such wildcard configuration can be handy, it is recommended when a finite set of values instead to provide a higher level of security. - - [[mvc-cors-processing]] == Processing [.small]#xref:web/webflux-cors.adoc#webflux-cors-processing[See equivalent in the Reactive stack]# @@ -103,8 +97,6 @@ To learn more from the source or make advanced customizations, check the code be ==== - - [[mvc-cors-controller]] == `@CrossOrigin` [.small]#xref:web/webflux-cors.adoc#webflux-cors-controller[See equivalent in the Reactive stack]# @@ -270,8 +262,6 @@ Kotlin:: ====== - - [[mvc-cors-global]] == Global Configuration [.small]#xref:web/webflux-cors.adoc#webflux-cors-global[See equivalent in the Reactive stack]# @@ -296,8 +286,6 @@ the `allowOriginPatterns` property may be used to match to a dynamic set of orig `maxAge` is set to 30 minutes. - - [[mvc-cors-global-java]] === Java Configuration [.small]#xref:web/webflux-cors.adoc#webflux-cors-global[See equivalent in the Reactive stack]# @@ -353,8 +341,6 @@ Kotlin:: ---- ====== - - [[mvc-cors-global-xml]] === XML Configuration @@ -379,8 +365,6 @@ as the following example shows: ---- - - [[mvc-cors-filter]] == CORS Filter [.small]#xref:web/webflux-cors.adoc#webflux-cors-webfilter[See equivalent in the Reactive stack]# diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc index ac8e5cec5b7..82fb164a949 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-functional.adoc @@ -9,8 +9,6 @@ It is an alternative to the annotation-based programming model but otherwise run the same xref:web/webmvc/mvc-servlet.adoc[DispatcherServlet]. - - [[webmvc-fn-overview]] == Overview [.small]#xref:web/webflux-functional.adoc#webflux-fn-overview[See equivalent in the Reactive stack]# @@ -110,9 +108,8 @@ Kotlin:: If you register the `RouterFunction` as a bean, for instance by exposing it in a -`@Configuration` class, it will be auto-detected by the servlet, as explained in xref:web/webmvc-functional.adoc#webmvc-fn-running[Running a Server]. - - +`@Configuration` class, it will be auto-detected by the servlet, as explained in +xref:web/webmvc-functional.adoc#webmvc-fn-running[Running a Server]. [[webmvc-fn-handler-functions]] @@ -122,7 +119,6 @@ If you register the `RouterFunction` as a bean, for instance by exposing it in a `ServerRequest` and `ServerResponse` are immutable interfaces that offer JDK 8-friendly access to the HTTP request and response, including headers, body, method, and status code. - [[webmvc-fn-request]] === ServerRequest @@ -188,7 +184,6 @@ val map = request.params() ---- ====== - [[webmvc-fn-response]] === ServerResponse @@ -335,8 +330,6 @@ Kotlin:: ---- ====== - - [[webmvc-fn-handler-classes]] === Handler Classes @@ -452,7 +445,6 @@ found. If it is not found, we return a 404 Not Found response. ====== -- - [[webmvc-fn-handler-validation]] === Validation @@ -528,7 +520,6 @@ a global `Validator` instance based on `LocalValidatorFactoryBean`. See xref:core/validation/beanvalidation.adoc[Spring Validation]. - [[webmvc-fn-router-functions]] == `RouterFunction` [.small]#xref:web/webflux-functional.adoc#webflux-fn-router-functions[See equivalent in the Reactive stack]# @@ -543,14 +534,14 @@ to create a router. Generally, it is recommended to use the `route()` builder, as it provides convenient short-cuts for typical mapping scenarios without requiring hard-to-discover static imports. -For instance, the router function builder offers the method `GET(String, HandlerFunction)` to create a mapping for GET requests; and `POST(String, HandlerFunction)` for POSTs. +For instance, the router function builder offers the method `GET(String, HandlerFunction)` +to create a mapping for GET requests; and `POST(String, HandlerFunction)` for POSTs. Besides HTTP method-based mapping, the route builder offers a way to introduce additional predicates when mapping to requests. For each HTTP method there is an overloaded variant that takes a `RequestPredicate` as a parameter, through which additional constraints can be expressed. - [[webmvc-fn-predicates]] === Predicates @@ -596,8 +587,6 @@ and `RequestPredicates.path(String)`. The example shown above also uses two request predicates, as the builder uses `RequestPredicates.GET` internally, and composes that with the `accept` predicate. - - [[webmvc-fn-routes]] === Routes @@ -677,7 +666,6 @@ Kotlin:: <4> `otherRoute` is a router function that is created elsewhere, and added to the route built. ====== - [[nested-routes]] === Nested Routes @@ -925,8 +913,6 @@ Kotlin:: ====== - - [[webmvc-fn-handler-filter-function]] == Filtering Handler Functions [.small]#xref:web/webflux-functional.adoc#webflux-fn-handler-filter-function[See equivalent in the Reactive stack]# diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view.adoc index a00afbd84cd..b67ed2c9616 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view.adoc @@ -14,4 +14,3 @@ WARNING: The views of a Spring MVC application live within the internal trust bo of that application. Views have access to all the beans of your application context. As such, it is not recommended to use Spring MVC's template support in applications where the templates are editable by external sources, since this can have security implications. - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-document.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-document.adoc index 469e7e5bd47..73e1e7c27e5 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-document.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-document.adoc @@ -5,7 +5,6 @@ Spring offers ways to return output other than HTML, including PDF and Excel spr This section describes how to use those features. - [[mvc-view-document-intro]] == Introduction to Document Views @@ -24,7 +23,6 @@ instead of the outdated original iText 2.1.7, since OpenPDF is actively maintain fixes an important vulnerability for untrusted PDF content. - [[mvc-view-document-pdf]] == PDF Views @@ -73,7 +71,6 @@ A controller can return such a view either from an external view definition (referencing it by name) or as a `View` instance from the handler method. - [[mvc-view-document-excel]] == Excel Views @@ -85,7 +82,3 @@ and `AbstractXlsxStreamingView`) that supersede the outdated `AbstractExcelView` The programming model is similar to `AbstractPdfView`, with `buildExcelDocument()` as the central template method and controllers being able to return such a view from an external definition (by name) or as a `View` instance from the handler method. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-feeds.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-feeds.adoc index 02f1512afbf..825dfd46607 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-feeds.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-feeds.adoc @@ -94,8 +94,6 @@ Kotlin:: ---- ====== - - The `buildFeedItems()` and `buildFeedEntries()` methods pass in the HTTP request, in case you need to access the Locale. The HTTP response is passed in only for the setting of cookies or other HTTP headers. The feed is automatically written to the response @@ -103,7 +101,3 @@ object after the method returns. For an example of creating an Atom view, see Alef Arendsen's Spring Team Blog {spring-site-blog}/2009/03/16/adding-an-atom-view-to-an-application-using-spring-s-rest-support[entry]. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-fragments.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-fragments.adoc index 45e4a57adc4..2e14cf0d056 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-fragments.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-fragments.adoc @@ -115,4 +115,4 @@ Kotlin:: ====== The same can also be done by returning `Flux`, or any other type adaptable -to a Reactive Streams `Publisher` through the `ReactiveAdapterRegistry`. \ No newline at end of file +to a Reactive Streams `Publisher` through the `ReactiveAdapterRegistry`. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-freemarker.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-freemarker.adoc index 0fadef3d1e2..f9c312d5251 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-freemarker.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-freemarker.adoc @@ -8,7 +8,6 @@ kind of text output from HTML to email and others. The Spring Framework has buil integration for using Spring MVC with FreeMarker templates. - [[mvc-view-freemarker-contextconfig]] == View Configuration [.small]#xref:web/webflux-view.adoc#webflux-view-freemarker-contextconfig[See equivalent in the Reactive stack]# @@ -98,7 +97,6 @@ returns a view name of `welcome`, the resolver looks for the `/WEB-INF/freemarker/welcome.ftl` template. - [[mvc-views-freemarker]] == FreeMarker Configuration [.small]#xref:web/webflux-view.adoc#webflux-views-freemarker[See equivalent in the Reactive stack]# @@ -127,7 +125,6 @@ See the FreeMarker documentation for details of settings and variables as they a the `Configuration` object. - [[mvc-view-freemarker-forms]] == Form Handling [.small]#xref:web/webflux-view.adoc#webflux-view-freemarker-forms[See equivalent in the Reactive stack]# @@ -138,7 +135,6 @@ form-backing objects and show the results of failed validations from a `Validato web or business tier. Spring also has support for the same functionality in FreeMarker, with additional convenience macros for generating form input elements themselves. - [[mvc-view-bind-macros]] === The Bind Macros [.small]#xref:web/webflux-view.adoc#webflux-view-bind-macros[See equivalent in the Reactive stack]# @@ -153,7 +149,6 @@ you need to directly call from within your templates. If you wish to view the ma directly, the file is called `spring.ftl` and is in the `org.springframework.web.servlet.view.freemarker` package. - [[mvc-view-simple-binding]] === Simple Binding @@ -197,7 +192,6 @@ messages or values. You can set it to `true` or `false` as required. Additional handling macros simplify the use of HTML escaping, and you should use these macros wherever possible. They are explained in the next section. - [[mvc-views-form-macros]] === Input Macros @@ -418,7 +412,6 @@ user still sees the more user-friendly city names, as follows: New York ---- - [[mvc-views-form-macros-html-escaping]] === HTML Escaping @@ -455,7 +448,3 @@ In similar fashion, you can specify HTML escaping per field, as the following ex <#assign htmlEscape = false in spring> <#-- all future fields will be bound with HTML escaping off --> ---- - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-groovymarkup.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-groovymarkup.adoc index 5df5c7a93d6..a15c3926137 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-groovymarkup.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-groovymarkup.adoc @@ -9,7 +9,6 @@ integration for using Spring MVC with Groovy Markup. NOTE: The Groovy Markup Template engine requires Groovy 2.3.1+. - [[mvc-view-groovymarkup-configuration]] == Configuration @@ -78,7 +77,6 @@ The following example shows how to configure the same in XML: ---- - [[mvc-view-groovymarkup-example]] == Example @@ -98,7 +96,3 @@ syntax. The following example shows a sample template for an HTML page: } } ---- - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jackson.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jackson.adoc index 3b419811c32..59e6e8e48e7 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jackson.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jackson.adoc @@ -6,7 +6,6 @@ Spring offers support for the Jackson JSON library. - [[mvc-view-json-mapping]] == Jackson-based JSON MVC Views [.small]#xref:web/webflux-view.adoc#webflux-view-httpmessagewriter[See equivalent in the Reactive stack]# @@ -25,7 +24,6 @@ through the `ObjectMapper` property, for cases where you need to provide custom serializers and deserializers for specific types. - [[mvc-view-xml-mapping]] == Jackson-based XML Views [.small]#xref:web/webflux-view.adoc#webflux-view-httpmessagewriter[See equivalent in the Reactive stack]# @@ -40,7 +38,3 @@ You can customize XML mapping as needed by using JAXB or Jackson's provided annotations. When you need further control, you can inject a custom `XmlMapper` through the `ObjectMapper` property, for cases where custom XML you need to provide serializers and deserializers for specific types. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jsp.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jsp.adoc index 8d095e720d5..6ca828bef56 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jsp.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-jsp.adoc @@ -4,7 +4,6 @@ The Spring Framework has a built-in integration for using Spring MVC with JSP and JSTL. - [[mvc-view-jsp-resolver]] == View Resolvers @@ -24,14 +23,11 @@ a directory under the `'WEB-INF'` directory so there can be no direct access by ---- - [[mvc-view-jsp-jstl]] == JSPs versus JSTL When using the JSP Standard Tag Library (JSTL) you must use a special view class, the -`JstlView`, as JSTL needs some preparation before things such as the I18N features can -work. - +`JstlView`, as JSTL needs some preparation before things such as the I18N features can work. [[mvc-view-jsp-tags]] @@ -64,7 +60,6 @@ JSPs easier to develop, read, and maintain. We go through the form tags and look at an example of how each tag is used. We have included generated HTML snippets where certain tags require further commentary. - [[mvc-view-jsp-formtaglib-configuration]] === Configuration @@ -80,7 +75,6 @@ page: ---- where `form` is the tag name prefix you want to use for the tags from this library. - [[mvc-view-jsp-formtaglib-formtag]] === The Form Tag @@ -168,7 +162,6 @@ following example shows: ---- - [[mvc-view-jsp-formtaglib-inputtag]] === The `input` Tag @@ -176,7 +169,6 @@ This tag renders an HTML `input` element with the bound value and `type='text'` For an example of this tag, see xref:web/webmvc-view/mvc-jsp.adoc#mvc-view-jsp-formtaglib-formtag[The Form Tag]. You can also use HTML5-specific types, such as `email`, `tel`, `date`, and others. - [[mvc-view-jsp-formtaglib-checkboxtag]] === The `checkbox` Tag @@ -306,7 +298,6 @@ prefixed by an underscore (`_`) for each checkbox. By doing this, you are effect telling Spring that "`the checkbox was visible in the form, and I want my object to which the form data binds to reflect the state of the checkbox, no matter what.`" - [[mvc-view-jsp-formtaglib-checkboxestag]] === The `checkboxes` Tag @@ -341,8 +332,6 @@ the map entry key is used as the value, and the map entry's value is used as the label to be displayed. You can also use a custom object where you can provide the property names for the value by using `itemValue` and the label by using `itemLabel`. - - [[mvc-view-jsp-formtaglib-radiobuttontag]] === The `radiobutton` Tag @@ -362,7 +351,6 @@ but with different values, as the following example shows: ---- - [[mvc-view-jsp-formtaglib-radiobuttonstag]] === The `radiobuttons` Tag @@ -384,7 +372,6 @@ by using `itemValue` and the label by using `itemLabel`, as the following exampl ---- - [[mvc-view-jsp-formtaglib-passwordtag]] === The `password` Tag @@ -414,7 +401,6 @@ password value to be shown, you can set the value of the `showPassword` attribut ---- - [[mvc-view-jsp-formtaglib-selecttag]] === The `select` Tag @@ -448,7 +434,6 @@ as follows: ---- - [[mvc-view-jsp-formtaglib-optiontag]] === The `option` Tag @@ -489,7 +474,6 @@ as follows: ---- <1> Note the addition of a `selected` attribute. - [[mvc-view-jsp-formtaglib-optionstag]] === The `options` Tag @@ -540,7 +524,6 @@ values and the map values correspond to option labels. If `itemValue` or `itemLa happen to be specified as well, the item value property applies to the map key, and the item label property applies to the map value. - [[mvc-view-jsp-formtaglib-textareatag]] === The `textarea` Tag @@ -555,7 +538,6 @@ This tag renders an HTML `textarea` element. The following HTML shows typical ou ---- - [[mvc-view-jsp-formtaglib-hiddeninputtag]] === The `hidden` Tag @@ -576,7 +558,6 @@ If we choose to submit the `house` value as a hidden one, the HTML would be as f ---- - [[mvc-view-jsp-formtaglib-errorstag]] === The `errors` Tag @@ -748,8 +729,6 @@ For a comprehensive reference on individual tags, browse the {spring-framework-api}/web/servlet/tags/form/package-summary.html#package.description[API reference] or see the tag library description. - - [[mvc-rest-method-conversion]] === HTTP Method Conversion @@ -832,7 +811,3 @@ The form `input` tag supports entering a type attribute other than `text`. This intended to allow rendering new HTML5 specific input types, such as `email`, `date`, `range`, and others. Note that entering `type='text'` is not required, since `text` is the default type. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-script.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-script.adoc index 3bb07dfbe06..87a61ad6ab3 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-script.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-script.adoc @@ -24,7 +24,6 @@ TIP: The basic rule for integrating any other script engine is that it must impl `ScriptEngine` and `Invocable` interfaces. - [[mvc-view-script-dependencies]] == Requirements [.small]#xref:web/webflux-view.adoc#webflux-view-script-dependencies[See equivalent in the Reactive stack]# @@ -44,7 +43,6 @@ You need to have the script templating library. One way to do that for JavaScrip through https://www.webjars.org/[WebJars]. - [[mvc-view-script-integrate]] == Script Templates [.small]#xref:web/webflux-view.adoc#webflux-view-script-integrate[See equivalent in the Reactive stack]# @@ -268,7 +266,3 @@ Check out the Spring Framework unit tests, {spring-framework-code}/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script[Java], and {spring-framework-code}/spring-webmvc/src/test/resources/org/springframework/web/servlet/view/script[resources], for more configuration examples. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-thymeleaf.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-thymeleaf.adoc index 48cf0c6d5ab..749530ee179 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-thymeleaf.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-thymeleaf.adoc @@ -16,7 +16,3 @@ The Thymeleaf integration with Spring MVC is managed by the Thymeleaf project. The configuration involves a few bean declarations, such as `ServletContextTemplateResolver`, `SpringTemplateEngine`, and `ThymeleafViewResolver`. See https://www.thymeleaf.org/documentation.html[Thymeleaf+Spring] for more details. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xml-marshalling.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xml-marshalling.adoc index 74f65108f21..db74ad83e4b 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xml-marshalling.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xml-marshalling.adoc @@ -8,7 +8,3 @@ marshalled by using a `MarshallingView` instance's `modelKey` bean property. Alt the view iterates over all model properties and marshals the first type that is supported by the `Marshaller`. For more information on the functionality in the `org.springframework.oxm` package, see xref:data-access/oxm.adoc[Marshalling XML using O/X Mappers]. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xslt.adoc b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xslt.adoc index 7fe25e7164a..8a5ba00b8b1 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xslt.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-xslt.adoc @@ -9,10 +9,9 @@ XSLT in a Spring Web MVC application. This example is a trivial Spring application that creates a list of words in the `Controller` and adds them to the model map. The map is returned, along with the view -name of our XSLT view. See xref:web/webmvc/mvc-controller.adoc[Annotated Controllers] for details of Spring Web MVC's -`Controller` interface. The XSLT controller turns the list of words into a simple XML -document ready for transformation. - +name of our XSLT view. See xref:web/webmvc/mvc-controller.adoc[Annotated Controllers] +for details of Spring Web MVC's `Controller` interface. The XSLT controller turns the +list of words into a simple XML document ready for transformation. [[mvc-view-xslt-beandefs]] @@ -137,7 +136,6 @@ too great a part in the structure of your model data, which is a danger when usi to manage the DOMification process. - [[mvc-view-xslt-transforming]] == Transformation diff --git a/framework-docs/modules/ROOT/pages/web/webmvc.adoc b/framework-docs/modules/ROOT/pages/web/webmvc.adoc index 8eaac910662..36b77455467 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc.adoc @@ -19,4 +19,3 @@ xref:web-reactive.adoc[Web on Reactive Stack]. For baseline information and compatibility with Servlet container and Jakarta EE version ranges, see the Spring Framework {spring-framework-wiki}/Spring-Framework-Versions[Wiki]. - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/filters.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/filters.adoc index ba61dc917b8..567e14d3ccc 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/filters.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/filters.adoc @@ -29,15 +29,12 @@ the body of the request, and wrap the `ServletRequest` to make the form data available through the `ServletRequest.getParameter{asterisk}()` family of methods. - [[filters-forwarded-headers]] == Forwarded Headers [.small]#xref:web/webflux/reactive-spring.adoc#webflux-forwarded-headers[See equivalent in the Reactive stack]# include::partial$web/forwarded-headers.adoc[] - - [[filters-forwarded-headers-non-forwardedheaderfilter]] === ForwardedHeaderFilter @@ -47,8 +44,6 @@ headers to eliminate further impact. The filter relies on wrapping the request, therefore it must be ordered ahead of other filters, such as `RequestContextFilter`, that should work with the modified and not the original request. - - [[filters-forwarded-headers-security]] === Security Considerations @@ -58,8 +53,6 @@ a proxy at the boundary of trust should be configured to remove untrusted `Forwa headers that come from the outside. You can also configure the `ForwardedHeaderFilter` with `removeOnly=true`, in which case it removes but does not use the headers. - - [[filters-forwarded-headers-dispatcher]] === Dispatcher Types @@ -72,7 +65,6 @@ types. However if registering the filter via `web.xml` or in Spring Boot via a `DispatcherType.ERROR` in addition to `DispatcherType.REQUEST`. - [[filters-shallow-etag]] == Shallow ETag @@ -100,7 +92,6 @@ the filter via `web.xml` or in Spring Boot via a `FilterRegistrationBean` be sur `DispatcherType.ASYNC`. - [[filters-cors]] == CORS [.small]#xref:web/webflux/reactive-spring.adoc#webflux-filters-cors[See equivalent in the Reactive stack]# @@ -112,7 +103,6 @@ controllers. However, when used with Spring Security, we advise relying on the b See the sections on xref:web/webmvc-cors.adoc[CORS] and the xref:web/webmvc-cors.adoc#mvc-cors-filter[CORS Filter] for more details. - [[filters.url-handler]] == URL Handler [.small]#xref:web/webflux/reactive-spring.adoc#filters.url-handler[See equivalent in the Reactive stack]# @@ -131,4 +121,3 @@ The `UrlHandlerFilter` Servlet filter has been designed for this purpose. It can Here is how you can instantiate and configure a `UrlHandlerFilter` for a blog application: include-code::./UrlHandlerFilterConfiguration[tag=config,indent=0] - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/message-converters.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/message-converters.adoc index 2b86c30d530..494cb9b6989 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/message-converters.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/message-converters.adoc @@ -79,5 +79,3 @@ content type. This requires the `com.google.protobuf:protobuf-java` dependency. This requires the `com.google.protobuf:protobuf-java-util` dependency. |=== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-async.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-async.adoc index 3f71ba48525..ea0a9ce87f6 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-async.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-async.adoc @@ -16,6 +16,7 @@ xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[reactive types] For an overview of how this differs from Spring WebFlux, see the xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-vs-webflux[Async Spring MVC compared to WebFlux] section below. + [[mvc-ann-async-deferredresult]] == `DeferredResult` @@ -62,7 +63,6 @@ The controller can produce the return value asynchronously, from a different thr example, in response to an external event (JMS message), a scheduled task, or other event. - [[mvc-ann-async-callable]] == `Callable` @@ -97,8 +97,6 @@ The return value can then be obtained by running the given task through the xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-configuration-spring-mvc[configured] `AsyncTaskExecutor`. - - [[mvc-ann-async-webasynctask]] == `WebAsyncTask` @@ -137,8 +135,6 @@ fun handle(): WebAsyncTask { ====== - - [[mvc-ann-async-processing]] == Processing @@ -183,7 +179,6 @@ For further background and context, you can also read {spring-site-blog}/2012/05/07/spring-mvc-3-2-preview-introducing-servlet-3-async-support[the blog posts] that introduced asynchronous request processing support in Spring MVC 3.2. - [[mvc-ann-async-exceptions]] === Exception Handling @@ -197,7 +192,6 @@ The exception then goes through the regular exception handling mechanism (for ex When you use `Callable`, similar processing logic occurs, the main difference being that the result is returned from the `Callable` or an exception is raised by it. - [[mvc-ann-async-interception]] === Interception @@ -216,7 +210,6 @@ See the {spring-framework-api}/web/context/request/async/DeferredResult.html[jav for more details. `Callable` can be substituted for `WebAsyncTask` that exposes additional methods for timeout and completion callbacks. - [[mvc-ann-async-vs-webflux]] === Async Spring MVC compared to WebFlux @@ -257,7 +250,6 @@ You can use `DeferredResult` and `Callable` for a single asynchronous return val What if you want to produce multiple asynchronous values and have those written to the response? This section describes how to do so. - [[mvc-ann-async-objects]] === Objects @@ -319,7 +311,6 @@ or `emitter.completeWithError`. Instead, the servlet container automatically ini This call, in turn, performs one final `ASYNC` dispatch to the application, during which Spring MVC invokes the configured exception resolvers and completes the request. - [[mvc-ann-async-sse]] === SSE @@ -379,7 +370,6 @@ a wide range of browsers. See also xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-objects[previous section] for notes on exception handling. - [[mvc-ann-async-output-stream]] === Raw Data @@ -419,7 +409,6 @@ You can use `StreamingResponseBody` as the body in a `ResponseEntity` to customize the status and headers of the response. - [[mvc-ann-async-reactive-types]] == Reactive Types [.small]#xref:web/webflux/reactive-spring.adoc#webflux-codecs-streaming[See equivalent in the Reactive stack]# @@ -452,8 +441,6 @@ xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-configuration-spring-mvc[config from `WebClient`. - - [[mvc-ann-async-context-propagation]] == Context Propagation @@ -499,7 +486,6 @@ For more details, see the {micrometer-context-propagation-docs}/[documentation] Micrometer Context Propagation library. - [[mvc-ann-async-disconnects]] == Disconnects [.small]#xref:web/webflux/reactive-spring.adoc#webflux-codecs-streaming[See equivalent in the Reactive stack]# @@ -516,14 +502,12 @@ xref:web/websocket/stomp.adoc[STOMP over WebSocket] or WebSocket with xref:web/w that have a built-in heartbeat mechanism. - [[mvc-ann-async-configuration]] == Configuration The asynchronous request processing feature must be enabled at the Servlet container level. The MVC configuration also exposes several options for asynchronous requests. - [[mvc-ann-async-configuration-servlet3]] === Servlet Container @@ -538,7 +522,6 @@ In `web.xml` configuration, you can add `true `DispatcherServlet` and to `Filter` declarations and add `ASYNC` to filter mappings. - [[mvc-ann-async-configuration-spring-mvc]] === Spring MVC @@ -560,4 +543,3 @@ The one used by default is not suitable for production under load. Note that you can also set the default timeout value on a `DeferredResult`, a `ResponseBodyEmitter`, and an `SseEmitter`. For a `Callable`, you can use `WebAsyncTask` to provide a timeout value. - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc index 788a32d0fff..ce39fbfca07 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc @@ -22,7 +22,6 @@ xref:web/webmvc/mvc-controller/ann-advice.adoc[@ControllerAdvice] that handles a and any `ErrorResponseException`, and renders an error response with a body. - [[mvc-ann-rest-exceptions-render]] == Render [.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-render[See equivalent in the Reactive stack]# @@ -49,7 +48,6 @@ xref:web/webmvc/mvc-config.adoc[MVC Config] with a `WebMvcConfigurer`. Use that any RFC 9457 response and take some action. - [[mvc-ann-rest-exceptions-non-standard]] == Non-Standard Fields [.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-non-standard[See equivalent in the Reactive stack]# @@ -69,7 +67,6 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro `ProblemDetail` of an exception into a subclass with the additional non-standard fields. - [[mvc-ann-rest-exceptions-i18n]] == Customization and i18n [.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-i18n[See equivalent in the Reactive stack]# @@ -195,7 +192,6 @@ xref:core/validation/beanvalidation.adoc#validation-beanvalidation-spring-method for more details. - [[mvc-ann-rest-exceptions-client]] == Client Handling [.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-client[See equivalent in the Reactive stack]# @@ -204,6 +200,3 @@ A client application can catch `WebClientResponseException`, when using the `Web or `RestClientResponseException` when using the `RestTemplate`, and use their `getResponseBodyAs` methods to decode the error response body to any target type such as `ProblemDetail`, or a subclass of `ProblemDetail`. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-caching.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-caching.adoc index 5e4a6a78288..fef2df4f240 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-caching.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-caching.adoc @@ -14,7 +14,6 @@ the `Last-Modified` header. This section describes the HTTP caching-related options that are available in Spring Web MVC. - [[mvc-caching-cachecontrol]] == `CacheControl` [.small]#xref:web/webflux/caching.adoc#webflux-caching-cachecontrol[See equivalent in the Reactive stack]# @@ -76,7 +75,6 @@ works as follows: `'Cache-Control: max-age=n'` directive. - [[mvc-caching-etag-lastmodified]] == Controllers [.small]#xref:web/webflux/caching.adoc#webflux-caching-etag-lastmodified[See equivalent in the Reactive stack]# @@ -181,14 +179,12 @@ Kotlin:: ====== -- - There are three variants for checking conditional requests against `eTag` values, `lastModified` values, or both. For conditional `GET` and `HEAD` requests, you can set the response to 304 (NOT_MODIFIED). For conditional `POST`, `PUT`, and `DELETE`, you can instead set the response to 412 (PRECONDITION_FAILED), to prevent concurrent modification. - [[mvc-caching-static-resources]] == Static Resources [.small]#xref:web/webflux/caching.adoc#webflux-caching-static-resources[See equivalent in the Reactive stack]# @@ -197,10 +193,8 @@ You should serve static resources with a `Cache-Control` and conditional respons for optimal performance. See the section on configuring xref:web/webmvc/mvc-config/static-resources.adoc[Static Resources]. - [[mvc-httpcaching-shallowetag]] == `ETag` Filter You can use the `ShallowEtagHeaderFilter` to add "`shallow`" `eTag` values that are computed from the response content and, thus, save bandwidth but not CPU time. See xref:web/webmvc/filters.adoc#filters-shallow-etag[Shallow ETag]. - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config.adoc index a29ad9a6e2b..e6fed64b279 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config.adoc @@ -13,6 +13,3 @@ see xref:web/webmvc/mvc-config/advanced-java.adoc[Advanced Java Config] and xref You do not need to understand the underlying beans created by the MVC Java configuration and the MVC namespace. If you want to learn more, see xref:web/webmvc/mvc-servlet/special-bean-types.adoc[Special Bean Types] and xref:web/webmvc/mvc-servlet/config.adoc[Web MVC Config]. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/advanced-java.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/advanced-java.adoc index b4f501e7331..4a79db746df 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/advanced-java.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/advanced-java.adoc @@ -17,6 +17,3 @@ include-code::./WebConfiguration[tag=snippet,indent=0] You can keep existing methods in `WebConfig`, but you can now also override bean declarations from the base class, and you can still have any number of other `WebMvcConfigurer` implementations on the classpath. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/content-negotiation.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/content-negotiation.adoc index 3850a9931ba..abe246e508a 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/content-negotiation.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/content-negotiation.adoc @@ -10,12 +10,10 @@ By default, only the `Accept` header is checked. If you must use URL-based content type resolution, consider using the query parameter strategy over path extensions. See -xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-suffix-pattern-match[Suffix Match] and xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-rfd[Suffix Match and RFD] for +xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-suffix-pattern-match[Suffix Match] +and xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-rfd[Suffix Match and RFD] for more details. You can customize requested content type resolution, as the following example shows: include-code::./WebConfiguration[tag=snippet,indent=0] - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/conversion.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/conversion.adoc index 54a92fa56bb..91e7cef26c2 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/conversion.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/conversion.adoc @@ -21,6 +21,3 @@ include-code::./DateTimeWebConfiguration[tag=snippet,indent=0] NOTE: See xref:core/validation/format.adoc#format-FormatterRegistrar-SPI[the `FormatterRegistrar` SPI] and the `FormattingConversionServiceFactoryBean` for more information on when to use FormatterRegistrar implementations. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/customize.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/customize.adoc index a42ea1388a4..596295044b5 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/customize.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/customize.adoc @@ -12,6 +12,3 @@ In XML, you can check attributes and sub-elements of ``. view the https://schema.spring.io/mvc/spring-mvc.xsd[Spring MVC XML schema] or use the code completion feature of your IDE to discover what attributes and sub-elements are available. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/enable.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/enable.adoc index b5beda90a00..27c2bde0385 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/enable.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/enable.adoc @@ -12,6 +12,3 @@ NOTE: When using Spring Boot, you may want to use `@Configuration` classes of ty The preceding example registers a number of Spring MVC xref:web/webmvc/mvc-servlet/special-bean-types.adoc[infrastructure beans] and adapts to dependencies available on the classpath (for example, payload converters for JSON, XML, and others). - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/static-resources.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/static-resources.adoc index 362adf674df..6898a692b28 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/static-resources.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/static-resources.adoc @@ -59,6 +59,3 @@ include the version of the jar and can also match against incoming URLs without TIP: The Java configuration based on `ResourceHandlerRegistry` provides further options for fine-grained control, for example, last-modified behavior and optimized resource resolution. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/validation.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/validation.adoc index b867977160f..bdf891578dd 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/validation.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/validation.adoc @@ -20,6 +20,3 @@ include-code::./MyController[tag=snippet,indent=0] TIP: If you need to have a `LocalValidatorFactoryBean` injected somewhere, create a bean and mark it with `@Primary` in order to avoid conflict with the one declared in the MVC configuration. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/view-controller.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/view-controller.adoc index 47d803b10c8..5d60781ec67 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/view-controller.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/view-controller.adoc @@ -15,6 +15,3 @@ annotated controller is considered a strong enough indication of endpoint owners that a 405 (METHOD_NOT_ALLOWED), a 415 (UNSUPPORTED_MEDIA_TYPE), or similar response can be sent to the client to help with debugging. For this reason it is recommended to avoid splitting URL handling across an annotated controller and a view controller. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller.adoc index d759e804cfb..4e7163ea630 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller.adoc @@ -49,6 +49,3 @@ but many other options exist and are explained later in this chapter. TIP: Guides and tutorials on {spring-site-guides}[spring.io] use the annotation-based programming model described in this section. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-advice.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-advice.adoc index f4af7ac1b4e..2e3ec0fd086 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-advice.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-advice.adoc @@ -66,7 +66,3 @@ The selectors in the preceding example are evaluated at runtime and may negative performance if used extensively. See the {spring-framework-api}/web/bind/annotation/ControllerAdvice.html[`@ControllerAdvice`] javadoc for more details. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc index 3a0f94e5720..6502fd63fe3 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc @@ -6,7 +6,6 @@ `@Controller` and xref:web/webmvc/mvc-controller/ann-advice.adoc[@ControllerAdvice] classes can have `@ExceptionHandler` methods to handle exceptions from controller methods, as the following example shows: - include-code::./SimpleController[indent=0] @@ -74,7 +73,6 @@ Support for `@ExceptionHandler` methods in Spring MVC is built on the `Dispatche level, xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[HandlerExceptionResolver] mechanism. - [[mvc-ann-exceptionhandler-media]] == Media Type Mapping [.small]#xref:web/webflux/controller/ann-exceptions.adoc#webflux-ann-exceptionhandler-media[See equivalent in the Reactive stack]# @@ -221,6 +219,3 @@ the content negotiation during the error handling phase will decide which conten by default, it is treated as a model attribute to be added to the model. If it is a simple type, it remains unresolved. |=== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-initbinder.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-initbinder.adoc index eca8278f350..5a00ce82fd0 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-initbinder.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-initbinder.adoc @@ -105,10 +105,9 @@ Kotlin:: <1> Defining an `@InitBinder` method on a custom formatter. ====== + [[mvc-ann-initbinder-model-design]] == Model Design [.small]#xref:web/webflux/controller/ann-initbinder.adoc#webflux-ann-initbinder-model-design[See equivalent in the Reactive stack]# include::partial$web/web-data-binding-model-design.adoc[] - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods.adoc index 853e26607d9..069a277d404 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods.adoc @@ -6,5 +6,3 @@ `@RequestMapping` handler methods have a flexible signature and can choose from a range of supported controller method arguments and return values. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/arguments.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/arguments.adoc index 4e3b30ea3c0..34c7fd75832 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/arguments.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/arguments.adoc @@ -138,5 +138,3 @@ and others) and is equivalent to `required=false`. {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty]), it is resolved as a `@RequestParam`. Otherwise, it is resolved as a `@ModelAttribute`. |=== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/cookievalue.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/cookievalue.adoc index f56b52b967e..473a697f0cc 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/cookievalue.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/cookievalue.adoc @@ -42,5 +42,3 @@ Kotlin:: If the target method parameter type is not `String`, type conversion is applied automatically. See xref:web/webmvc/mvc-controller/ann-methods/typeconversion.adoc[Type Conversion]. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc index b4ecd70d027..92a41c5a715 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc @@ -42,5 +42,3 @@ This does not entirely eliminate the possibility of a concurrency issue but reduces it greatly with information that is already available in the redirect URL. Therefore, we recommend that you use flash attributes mainly for redirect scenarios. **** - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/httpentity.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/httpentity.adoc index 80e75a0e7d3..2d3d2f3c978 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/httpentity.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/httpentity.adoc @@ -28,6 +28,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/jackson.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/jackson.adoc index b8c24d6641a..9161c5a61fe 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/jackson.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/jackson.adoc @@ -158,6 +158,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/matrix-variables.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/matrix-variables.adoc index 440bc376ed8..a5a04264ec5 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/matrix-variables.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/matrix-variables.adoc @@ -161,5 +161,3 @@ Note that you need to enable the use of matrix variables. In the MVC Java config you need to set a `UrlPathHelper` with `removeSemicolonContent=false` through xref:web/webmvc/mvc-config/path-matching.adoc[Path Matching]. In the MVC XML namespace, you can set ``. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/multipart-forms.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/multipart-forms.adoc index 55c11bcbfa5..c2f4386df72 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/multipart-forms.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/multipart-forms.adoc @@ -207,5 +207,3 @@ Kotlin:: If method validation applies because other parameters have `@Constraint` annotations, then `HandlerMethodValidationException` is raised instead. For more details, see the section on xref:web/webmvc/mvc-controller/ann-validation.adoc[Validation]. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/redirecting-passing-data.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/redirecting-passing-data.adoc index 645f2a25ae1..3361914edbf 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/redirecting-passing-data.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/redirecting-passing-data.adoc @@ -51,8 +51,7 @@ Kotlin:: ---- ====== -Another way of passing data to the redirect target is by using flash attributes. Unlike -other redirect attributes, flash attributes are saved in the HTTP session (and, hence, do -not appear in the URL). See xref:web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc[Flash Attributes] for more information. - - +Another way of passing data to the redirect target is by using flash attributes. Unlike other +redirect attributes, flash attributes are saved in the HTTP session (and, hence, do not appear +in the URL). See xref:web/webmvc/mvc-controller/ann-methods/flash-attributes.adoc[Flash Attributes] +for more information. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestattrib.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestattrib.adoc index 76da7fff882..3e1edf25f15 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestattrib.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestattrib.adoc @@ -31,5 +31,3 @@ Kotlin:: ---- <1> Using the `@RequestAttribute` annotation. ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestbody.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestbody.adoc index afb1509394d..781038a3b75 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestbody.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestbody.adoc @@ -30,9 +30,9 @@ Kotlin:: ---- ====== - -You can use the xref:web/webmvc/mvc-config/message-converters.adoc[Message Converters] option of the xref:web/webmvc/mvc-config.adoc[MVC Config] to -configure or customize message conversion. +You can use the +xref:web/webmvc/mvc-config/message-converters.adoc[Message Converters] option of the xref:web/webmvc/mvc-config.adoc[MVC Config] +to configure or customize message conversion. NOTE: Form data should be read using xref:web/webmvc/mvc-controller/ann-methods/requestparam.adoc[`@RequestParam`], not with `@RequestBody` which can't always be used reliably since in the Servlet API, request parameter @@ -71,4 +71,3 @@ Kotlin:: If method validation applies because other parameters have `@Constraint` annotations, then `HandlerMethodValidationException` is raised instead. For more details, see the section on xref:web/webmvc/mvc-controller/ann-validation.adoc[Validation]. - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestheader.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestheader.adoc index 99c1bcd0f6a..d6c00e5f24a 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestheader.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestheader.adoc @@ -52,8 +52,8 @@ Kotlin:: <2> Get the value of the `Keep-Alive` header. ====== -If the target method parameter type is not -`String`, type conversion is automatically applied. See xref:web/webmvc/mvc-controller/ann-methods/typeconversion.adoc[Type Conversion]. +If the target method parameter type is not `String`, type conversion is automatically applied. +See xref:web/webmvc/mvc-controller/ann-methods/typeconversion.adoc[Type Conversion]. When an `@RequestHeader` annotation is used on a `Map`, `MultiValueMap`, or `HttpHeaders` argument, the map is populated @@ -63,5 +63,3 @@ TIP: Built-in support is available for converting a comma-separated string into array or collection of strings or other types known to the type conversion system. For example, a method parameter annotated with `@RequestHeader("Accept")` can be of type `String` but also `String[]` or `List`. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc index 839e0f57eab..1563d85dd5b 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/requestparam.adoc @@ -120,5 +120,3 @@ By default, any argument that is a simple value type (as determined by {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty]) and is not resolved by any other argument resolver, is treated as if it were annotated with `@RequestParam`. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responsebody.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responsebody.adoc index 8d2d827cee3..02bfeb1f2aa 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responsebody.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responsebody.adoc @@ -45,12 +45,11 @@ for such a purpose, make sure to construct it with an on-demand `InputStreamSour (for example, through a lambda expression that retrieves the actual `InputStream`). You can use `@ResponseBody` with reactive types. -See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types] for more details. +See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and +xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types] for more details. -You can use the xref:web/webmvc/mvc-config/message-converters.adoc[Message Converters] option of the xref:web/webmvc/mvc-config.adoc[MVC Config] to -configure or customize message conversion. +You can use the xref:web/webmvc/mvc-config/message-converters.adoc[Message Converters] option +of the xref:web/webmvc/mvc-config.adoc[MVC Config] to configure or customize message conversion. You can combine `@ResponseBody` methods with JSON serialization views. See xref:web/webmvc/mvc-controller/ann-methods/jackson.adoc[Jackson JSON] for details. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responseentity.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responseentity.adoc index f61a9878b1f..eb2e13731ae 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responseentity.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/responseentity.adoc @@ -3,7 +3,8 @@ [.small]#xref:web/webflux/controller/ann-methods/responseentity.adoc[See equivalent in the Reactive stack]# -`ResponseEntity` is like xref:web/webmvc/mvc-controller/ann-methods/responsebody.adoc[`@ResponseBody`] but with status and headers. For example: +`ResponseEntity` is like xref:web/webmvc/mvc-controller/ann-methods/responsebody.adoc[`@ResponseBody`] +but with status and headers. For example: [tabs] ====== @@ -54,5 +55,3 @@ types for the body. This allows the following types of async responses: * `Mono>` provides all three -- response status, headers, and body, asynchronously at a later point. This allows the response status and headers to vary depending on the outcome of asynchronous request handling. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc index bd6aa862ec1..29bf34c7b91 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc @@ -101,5 +101,3 @@ supported for all return values. {spring-framework-api}/beans/BeanUtils.html#isSimpleProperty-java.lang.Class-[BeanUtils#isSimpleProperty], in which case it remains unresolved. |=== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattribute.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattribute.adoc index 5e7754d3c4e..3e32bee6e54 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattribute.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattribute.adoc @@ -40,5 +40,3 @@ For use cases that require adding or removing session attributes, consider injec For temporary storage of model attributes in the session as part of a controller workflow, consider using `@SessionAttributes` as described in xref:web/webmvc/mvc-controller/ann-methods/sessionattributes.adoc[`@SessionAttributes`]. - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattributes.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattributes.adoc index f9497c08bb4..bff111b04a8 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattributes.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/sessionattributes.adoc @@ -91,5 +91,3 @@ class EditPetForm { <1> Storing the `Pet` value in the Servlet session. <2> Clearing the `Pet` value from the Servlet session. ====== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/typeconversion.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/typeconversion.adoc index 76f10b3d40e..dc122a903a5 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/typeconversion.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/typeconversion.adoc @@ -30,5 +30,3 @@ Alternatively, you may specifically handle, for example, the resulting `MissingP in the case of a required `@PathVariable`. A null value after conversion will be treated like an empty original value, so the corresponding `Missing...Exception` variants will be thrown. ==== - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-modelattrib-methods.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-modelattrib-methods.adoc index c0e28ba010f..0529708ea4f 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-modelattrib-methods.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-modelattrib-methods.adoc @@ -112,6 +112,3 @@ Kotlin:: } ---- ====== - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc index a8cc9756dec..902a56ac7f4 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc @@ -6,7 +6,6 @@ This section discusses request mapping for annotated controllers. - [[mvc-ann-requestmapping-annotation]] == `@RequestMapping` @@ -25,9 +24,10 @@ There are also HTTP method specific shortcut variants of `@RequestMapping`: * `@DeleteMapping` * `@PatchMapping` -The shortcuts are xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-composed[Custom Annotations] that are provided because, -arguably, most controller methods should be mapped to a specific HTTP method versus -using `@RequestMapping`, which, by default, matches to all HTTP methods. +The shortcuts are +xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-composed[Custom Annotations] +that are provided because, arguably, most controller methods should be mapped to a specific +HTTP method versus using `@RequestMapping`, which, by default, matches to all HTTP methods. A `@RequestMapping` is still needed at the class level to express shared mappings. NOTE: `@RequestMapping` cannot be used in conjunction with other `@RequestMapping` @@ -84,7 +84,6 @@ Kotlin:: ====== - [[mvc-ann-requestmapping-uri-templates]] == URI patterns [.small]#xref:web/webflux/controller/ann-requestmapping.adoc#webflux-ann-requestmapping-uri-templates[See equivalent in the Reactive stack]# @@ -224,7 +223,6 @@ other property sources. You can use this, for example, to parameterize a base UR some external configuration. - [[mvc-ann-requestmapping-pattern-comparison]] == Pattern Comparison [.small]#xref:web/webflux/controller/ann-requestmapping.adoc#webflux-ann-requestmapping-pattern-comparison[See equivalent in the Reactive stack]# @@ -455,7 +453,8 @@ Kotlin:: ====== TIP: You can match `Content-Type` and `Accept` with the headers condition, but it is better to use -xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-consumes[consumes] and xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-produces[produces] +xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-consumes[consumes] +and xref:web/webmvc/mvc-controller/ann-requestmapping.adoc#mvc-ann-requestmapping-produces[produces] instead. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann.adoc index 493d1d74d5f..d95c9b0fd62 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann.adoc @@ -39,6 +39,3 @@ NOTE: Keep in mind that as of 6.0, with interface proxying, Spring MVC no longer controllers based solely on a type-level `@RequestMapping` annotation on the interface. Please, enable class based proxying, or otherwise the interface must also have an `@Controller` annotation. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-http2.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-http2.adoc index da03fba9b4a..8edc97a73f6 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-http2.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-http2.adoc @@ -12,4 +12,5 @@ For more details, see the The Servlet API does expose one construct related to HTTP/2. You can use the `jakarta.servlet.http.PushBuilder` to proactively push resources to clients, and it -is supported as a xref:web/webmvc/mvc-controller/ann-methods/arguments.adoc[method argument] to `@RequestMapping` methods. +is supported as a xref:web/webmvc/mvc-controller/ann-methods/arguments.adoc[method argument] +to `@RequestMapping` methods. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-security.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-security.adoc index 9a4f769aa5a..50143f08a06 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-security.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-security.adoc @@ -14,7 +14,3 @@ reference documentation, including: * {docs-spring-security}/features/exploits/headers.html[Security Response Headers] https://github.com/hdiv/hdiv[HDIV] is another web security framework that integrates with Spring MVC. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet.adoc index 5205cec16d1..34d9fd30c4f 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-servlet.adoc @@ -112,6 +112,3 @@ bootstrap itself and the embedded Servlet container. `Filter` and `Servlet` decl are detected in Spring configuration and registered with the Servlet container. For more details, see the {spring-boot-docs-ref}/web/servlet.html#web.servlet.embedded-container[Spring Boot documentation]. - - - diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-uri-building.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-uri-building.adoc index 4aba9d6ff6c..bd1ff485dbe 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-uri-building.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-uri-building.adoc @@ -8,7 +8,6 @@ This section describes various options available in the Spring Framework to work include::partial$web/web-uris.adoc[leveloffset=+1] - [[mvc-servleturicomponentsbuilder]] == Relative Servlet Requests @@ -117,7 +116,6 @@ xref:web/webmvc/filters.adoc#filters-forwarded-headers[`ForwardedHeaderFilter`] such headers. - [[mvc-links-to-controllers]] == Links to Controllers @@ -267,7 +265,6 @@ xref:web/webmvc/filters.adoc#filters-forwarded-headers[ForwardedHeaderFilter] to such headers. - [[mvc-links-to-controllers-from-views]] == Links in Views @@ -322,7 +319,3 @@ capital letters of the class and the method name (for example, the `getThing` me `ThingController` becomes "TC#getThing"). If there is a name clash, you can use `@RequestMapping(name="..")` to assign an explicit name or implement your own `HandlerMethodMappingNamingStrategy`. - - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket.adoc b/framework-docs/modules/ROOT/pages/web/websocket.adoc index f917e7e0939..9f623514262 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket.adoc @@ -9,5 +9,3 @@ messaging that includes raw WebSocket interactions, WebSocket emulation through publish-subscribe messaging through STOMP as a sub-protocol over WebSocket. include::partial$web/websocket-intro.adoc[leveloffset=+1] - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/fallback.adoc b/framework-docs/modules/ROOT/pages/web/websocket/fallback.adoc index c79fd0a70f8..86b979a76b4 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/fallback.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/fallback.adoc @@ -13,7 +13,6 @@ On the Servlet stack, the Spring Framework provides both server (and also client for the SockJS protocol. - [[websocket-fallback-sockjs-overview]] == Overview @@ -78,7 +77,6 @@ For even more detail, see the SockJS protocol https://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html[narrated test]. - [[websocket-fallback-sockjs-enable]] == Enabling SockJS @@ -101,7 +99,6 @@ transport types supported by browser. The client also provides several configuration options -- for example, to specify which transports to include. - [[websocket-fallback-xhr-vs-iframe]] == IE 8 and 9 @@ -182,7 +179,6 @@ be cached. For details on how to enable it see the {sockjs-client}[SockJS client] page. - [[websocket-fallback-sockjs-heartbeat]] == Heartbeats @@ -202,7 +198,6 @@ with default settings based on the number of available processors. You should consider customizing the settings according to your specific needs. - [[websocket-fallback-sockjs-servlet3-async]] == Client Disconnects @@ -229,15 +224,15 @@ a minimal message by using the dedicated log category, `DISCONNECTED_CLIENT_LOG_ log category to TRACE. - [[websocket-fallback-cors]] == SockJS and CORS -If you allow cross-origin requests (see xref:web/websocket/server.adoc#websocket-server-allowed-origins[Allowed Origins]), the SockJS protocol -uses CORS for cross-domain support in the XHR streaming and polling transports. Therefore, -CORS headers are added automatically, unless the presence of CORS headers in the response -is detected. So, if an application is already configured to provide CORS support (for example, -through a Servlet Filter), Spring's `SockJsService` skips this part. +If you allow cross-origin requests (see +xref:web/websocket/server.adoc#websocket-server-allowed-origins[Allowed Origins]), the SockJS +protocol uses CORS for cross-domain support in the XHR streaming and polling transports. +Therefore, CORS headers are added automatically, unless the presence of CORS headers in the +response is detected. So, if an application is already configured to provide CORS support +(for example, through a Servlet Filter), Spring's `SockJsService` skips this part. It is also possible to disable the addition of these CORS headers by setting the `suppressCors` property in Spring's SockJsService. @@ -257,7 +252,6 @@ Alternatively, if the CORS configuration allows it, consider excluding URLs with SockJS endpoint prefix, thus letting Spring's `SockJsService` handle it. - [[websocket-fallback-sockjs-client]] == `SockJsClient` @@ -333,7 +327,3 @@ that you should also consider customizing: <2> Set the `httpMessageCacheSize` property to 1,000 (the default is `100`). <3> Set the `disconnectDelay` property to 30 property seconds (the default is five seconds -- `5 * 1000`). - - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/server.adoc b/framework-docs/modules/ROOT/pages/web/websocket/server.adoc index 13c005fedf3..f47f8c45996 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/server.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/server.adoc @@ -7,7 +7,6 @@ The Spring Framework provides a WebSocket API that you can use to write client- server-side applications that handle WebSocket messages. - [[websocket-server-handler]] == `WebSocketHandler` [.small]#xref:web/webflux-websocket.adoc#webflux-websocket-server-handler[See equivalent in the Reactive stack]# @@ -36,7 +35,6 @@ sending. One option is to wrap the `WebSocketSession` with {spring-framework-api}/web/socket/handler/ConcurrentWebSocketSessionDecorator.html[`ConcurrentWebSocketSessionDecorator`]. - [[websocket-server-handshake]] == WebSocket Handshake [.small]#xref:web/webflux-websocket.adoc#webflux-websocket-server-handshake[See equivalent in the Reactive stack]# @@ -67,7 +65,6 @@ exceptions that arise from any `WebSocketHandler` method and closes the WebSocke session with status `1011`, which indicates a server error. - [[websocket-server-deployment]] == Deployment @@ -132,7 +129,6 @@ Java initialization API. The following example shows how to do so: ---- - [[websocket-server-runtime-configuration]] == Configuring the Server [.small]#xref:web/webflux-websocket.adoc#webflux-websocket-server-config[See equivalent in the Reactive stack]# @@ -158,7 +154,6 @@ xref:web/websocket/stomp/server-config.adoc[STOMP WebSocket transport] properties. - [[websocket-server-allowed-origins]] == Allowed Origins [.small]#xref:web/webflux-websocket.adoc#webflux-websocket-server-cors[See equivalent in the Reactive stack]# diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp.adoc index 405d956c8a1..aa8c4ac5975 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp.adoc @@ -8,6 +8,3 @@ sub-protocol (that is, a higher-level messaging protocol) to use on top of WebSo define what kind of messages each can send, what the format is, the content of each message, and so on. The use of a sub-protocol is optional but, either way, the client and the server need to agree on some protocol that defines message content. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/application-context-events.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/application-context-events.adoc index 7d59414d2cc..5fd70abac99 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/application-context-events.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/application-context-events.adoc @@ -35,6 +35,3 @@ NOTE: When you use a full-featured broker, the STOMP "`broker relay`" automatica however, are not automatically reconnected. Assuming heartbeats are enabled, the client typically notices the broker is not responding within 10 seconds. Clients need to implement their own reconnecting logic. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication-token-based.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication-token-based.adoc index b65811e74b8..f88920cb87d 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication-token-based.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication-token-based.adoc @@ -47,6 +47,3 @@ you need to ensure that the authentication `ChannelInterceptor` config is ordere ahead of Spring Security's. This is best done by declaring the custom interceptor in its own implementation of `WebSocketMessageBrokerConfigurer` that is marked with `@Order(Ordered.HIGHEST_PRECEDENCE + 99)`. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication.adoc index b8dafd67d43..a2bc8d09db7 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authentication.adoc @@ -29,6 +29,3 @@ Those were originally designed for and are needed for STOMP over TCP. However, f over WebSocket, by default, Spring ignores authentication headers at the STOMP protocol level, and assumes that the user is already authenticated at the HTTP transport level. The expectation is that the WebSocket or SockJS session contain the authenticated user. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authorization.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authorization.adoc index 95af447e597..a8a3bc520a0 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/authorization.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/authorization.adoc @@ -8,6 +8,3 @@ that uses a `ChannelInterceptor` to authorize messages based on the user header Also, Spring Session provides {docs-spring-session}/web-socket.html[WebSocket integration] that ensures the user's HTTP session does not expire while the WebSocket session is still active. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/benefits.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/benefits.adoc index 31e3e7f3224..3550cc14337 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/benefits.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/benefits.adoc @@ -16,6 +16,3 @@ manage subscriptions and broadcast messages. routed to them based on the STOMP destination header versus handling raw WebSocket messages with a single `WebSocketHandler` for a given connection. * You can use Spring Security to secure messages based on STOMP destinations and message types. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/client.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/client.adoc index ba205223a86..9de2b02e429 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/client.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/client.adoc @@ -119,6 +119,3 @@ messages. When an inbound STOMP message size exceeds the configured limit, a stompClient.setInboundMessageSizeLimit(64 * 1024); // 64KB stompClient.setOutboundMessageSizeLimit(64 * 1024); // 64KB ---- - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/configuration-performance.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/configuration-performance.adoc index cc5df948025..1456a7e0770 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/configuration-performance.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/configuration-performance.adoc @@ -88,6 +88,3 @@ However, when you use a full-featured broker (such as RabbitMQ), each applicatio instance connects to the broker, and messages broadcast from one application instance can be broadcast through the broker to WebSocket clients connected through any other application instances. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/destination-separator.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/destination-separator.adoc index 0c81e2c2b86..51de770cf82 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/destination-separator.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/destination-separator.adoc @@ -24,6 +24,3 @@ the broker you use to see what conventions it supports for the destination heade The "`simple broker`", on the other hand, does rely on the configured `PathMatcher`, so, if you switch the separator, that change also applies to the broker and the way the broker matches destinations from a message to patterns in subscriptions. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/enable.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/enable.adoc index 831b1ff8dfa..021093ab65b 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/enable.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/enable.adoc @@ -46,4 +46,3 @@ For more example code see: interactive web application] -- a getting started guide. * https://github.com/rstoyanchev/spring-websocket-portfolio[Stock Portfolio] -- a sample application. - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-annotations.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-annotations.adoc index 7479fd6dc97..db856e597c0 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-annotations.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-annotations.adoc @@ -180,6 +180,3 @@ Typically, `@MessageExceptionHandler` methods apply within the `@Controller` cla more globally (across controllers), you can declare them in a class marked with `@ControllerAdvice`. This is comparable to the xref:web/webmvc/mvc-controller/ann-advice.adoc[similar support] available in Spring MVC. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay-configure.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay-configure.adoc index f13d532367f..39abc583994 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay-configure.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay-configure.adoc @@ -43,6 +43,3 @@ The value of this property is set as the `host` header of every `CONNECT` frame and can be useful (for example, in a cloud environment where the actual host to which the TCP connection is established differs from the host that provides the cloud-based STOMP service). - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay.adoc index fd0ddcec226..8150421b59a 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-broker-relay.adoc @@ -33,6 +33,3 @@ business services, and others) can also send messages to the broker relay, as de in xref:web/websocket/stomp/handle-send.adoc[Sending Messages], to broadcast messages to subscribed WebSocket clients. In effect, the broker relay enables robust and scalable message broadcasting. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-send.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-send.adoc index e193522ab0c..0af57f19037 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-send.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/handle-send.adoc @@ -30,6 +30,3 @@ type, as the following example shows: However, you can also qualify it by its name (`brokerMessagingTemplate`), if another bean of the same type exists. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/interceptors.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/interceptors.adoc index 9bdab983516..1f7c794edb3 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/interceptors.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/interceptors.adoc @@ -24,6 +24,3 @@ can be from the client or it can also be automatically generated when the WebSocket session is closed. In some cases, an interceptor may intercept this message more than once for each session. Components should be idempotent with regard to multiple disconnect events. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/message-flow.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/message-flow.adoc index aee0cd9adc8..2b4cb25c87b 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/message-flow.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/message-flow.adoc @@ -85,6 +85,3 @@ and sent on the WebSocket connection. The next section provides more details on annotated methods, including the kinds of arguments and return values that are supported. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/overview.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/overview.adoc index cf94589ba1d..52990bbb6f5 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/overview.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/overview.adoc @@ -92,6 +92,3 @@ client subscription. The preceding overview is intended to provide the most basic understanding of the STOMP protocol. We recommended reviewing the protocol https://stomp.github.io/stomp-specification-1.2.html[specification] in full. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/scope.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/scope.adoc index b4300990abe..b066e00e56a 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/scope.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/scope.adoc @@ -64,6 +64,3 @@ time it is accessed from the controller and stores the instance in the WebSocket session attributes. The same instance is subsequently returned until the session ends. WebSocket-scoped beans have all Spring lifecycle methods invoked, as shown in the preceding examples. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/stats.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/stats.adoc index 107f353fd42..eb8e4f69b93 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/stats.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/stats.adoc @@ -54,6 +54,3 @@ Client Outbound Channel:: Statistics from the thread pool that backs the `client SockJS Task Scheduler:: Statistics from the thread pool of the SockJS task scheduler that is used to send heartbeats. Note that, when heartbeats are negotiated on the STOMP level, the SockJS heartbeats are disabled. - - - diff --git a/framework-docs/modules/ROOT/pages/web/websocket/stomp/user-destination.adoc b/framework-docs/modules/ROOT/pages/web/websocket/stomp/user-destination.adoc index 84fef9ffb79..9d22069b27b 100644 --- a/framework-docs/modules/ROOT/pages/web/websocket/stomp/user-destination.adoc +++ b/framework-docs/modules/ROOT/pages/web/websocket/stomp/user-destination.adoc @@ -112,6 +112,3 @@ destination to broadcast unresolved messages so that other servers have a chance This can be done through the `userDestinationBroadcast` property of the `MessageBrokerRegistry` in Java configuration and the `user-destination-broadcast` attribute of the `message-broker` element in XML. - - - diff --git a/framework-docs/modules/ROOT/partials/web/forwarded-headers.adoc b/framework-docs/modules/ROOT/partials/web/forwarded-headers.adoc index fa1de23973a..45e48114a61 100644 --- a/framework-docs/modules/ROOT/partials/web/forwarded-headers.adoc +++ b/framework-docs/modules/ROOT/partials/web/forwarded-headers.adoc @@ -5,15 +5,12 @@ host, port, and scheme from a client perspective. {rfc-site}/rfc7239[RFC 7239] defines the `Forwarded` HTTP header that proxies can use to provide information about the original request. - - [[forwarded-headers-non-standard]] === Non-standard Headers There are other non-standard headers, too, including `X-Forwarded-Host`, `X-Forwarded-Port`, `X-Forwarded-Proto`, `X-Forwarded-Ssl`, and `X-Forwarded-Prefix`. - [[x-forwarded-host]] ==== X-Forwarded-Host @@ -23,7 +20,6 @@ downstream server. For example, if a request of `https://example.com/resource` i a proxy which forwards the request to `http://localhost:8080/resource`, then a header of `X-Forwarded-Host: example.com` can be sent to inform the server that the original host was `example.com`. - [[x-forwarded-port]] ==== X-Forwarded-Port @@ -33,7 +29,6 @@ communicate the original port to a downstream server. For example, if a request `http://localhost:8080/resource`, then a header of `X-Forwarded-Port: 443` can be sent to inform the server that the original port was `443`. - [[x-forwarded-proto]] ==== X-Forwarded-Proto @@ -43,7 +38,6 @@ to a downstream server. For example, if a request of `https://example.com/resour a proxy which forwards the request to `http://localhost:8080/resource`, then a header of `X-Forwarded-Proto: https` can be sent to inform the server that the original protocol was `https`. - [[x-forwarded-ssl]] ==== X-Forwarded-Ssl @@ -53,7 +47,6 @@ original protocol (for example, https / https) to a downstream server. For examp `http://localhost:8080/resource`, then a header of `X-Forwarded-Ssl: on` to inform the server that the original protocol was `https`. - [[x-forwarded-prefix]] ==== X-Forwarded-Prefix diff --git a/framework-docs/modules/ROOT/partials/web/websocket-intro.adoc b/framework-docs/modules/ROOT/partials/web/websocket-intro.adoc index 60c972a4147..e2a18e4c2f6 100644 --- a/framework-docs/modules/ROOT/partials/web/websocket-intro.adoc +++ b/framework-docs/modules/ROOT/partials/web/websocket-intro.adoc @@ -52,8 +52,6 @@ server. Likewise, if the application runs in a cloud environment, check the instructions of the cloud provider related to WebSocket support. - - [[http-versus-websocket]] == HTTP Versus WebSocket @@ -78,8 +76,6 @@ WebSocket clients and servers can negotiate the use of a higher-level, messaging In the absence of that, they need to come up with their own conventions. - - [[when-to-use-websockets]] == When to Use WebSockets From 25b4e29f5e742dfaa834cce52f46367970f6f6bb Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Jul 2025 19:33:51 +0200 Subject: [PATCH 2/2] Polishing --- .../src/main/java/org/springframework/context/Lifecycle.java | 4 ++-- .../web/servlet/mvc/method/annotation/SseEmitter.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/Lifecycle.java b/spring-context/src/main/java/org/springframework/context/Lifecycle.java index 81a73fb58d5..12a2d0dd0e5 100644 --- a/spring-context/src/main/java/org/springframework/context/Lifecycle.java +++ b/spring-context/src/main/java/org/springframework/context/Lifecycle.java @@ -52,8 +52,8 @@ public interface Lifecycle { /** * Start this component. *

Should not throw an exception if the component is already running. - *

In the case of a container, this will propagate the start signal to all - * components that apply. + *

In the case of a container, this will propagate a hard start signal to all + * components that apply, even to non-auto-startup components. * @see SmartLifecycle#isAutoStartup() */ void start(); diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java index e7be5eb430f..99f94668d60 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java @@ -46,11 +46,10 @@ public class SseEmitter extends ResponseBodyEmitter { private static final MediaType TEXT_PLAIN = new MediaType("text", "plain", StandardCharsets.UTF_8); - /** - * Guards access to write operations on the response. - */ + /** Guards access to write operations on the response. */ private final Lock writeLock = new ReentrantLock(); + /** * Create a new SseEmitter instance. */