Commit Graph

2251 Commits

Author SHA1 Message Date
Sam Brannen c5284009a1 Fix UriComponentsBuilder examples in ref docs
Closes gh-26453
2021-01-27 15:16:15 +01:00
daisuzz d96448fde9
Fix typo in URI Encoding section of reference docs
Closes gh-26436
2021-01-24 14:38:33 +01:00
Arjen Poutsma d80b08084e Document ordering of RouterFunction beans
Closes gh-26283
2021-01-14 16:18:22 +01:00
Rossen Stoyanchev a7413ea76b Add recommendation for original multipart filename
See gh-26299
2021-01-12 17:28:44 +00:00
Rossen Stoyanchev c3c36ab498 Document choices for async ResponseEntity return values
Closes gh-22614
2021-01-12 14:37:01 +00:00
Juergen Hoeller be5eb7037f Explicit notes on non-null enforcement and deep cause support in 5.3
Closes gh-26296
See gh-26317
2021-01-11 19:04:12 +01:00
Sam Brannen fff2291f2a Document context lifecycle & logging semantics for the TestContext framework
This commit documents ApplicationContext initialization and shutdown
logging semantics for console output triggered in conjunction with the
Spring TestContext Framework.

Closes gh-25385
2021-01-11 17:48:33 +01:00
Rossen Stoyanchev d50375da8e Add more static imports to MockMvc snippets
Closes gh-26311
2021-01-06 21:56:14 +00:00
diguage eab61f692f Merge source and substitution configuration in reference docs
Closes gh-25545
2020-12-28 20:49:36 +01:00
Sam Brannen 1565f4b83e Introduce ApplicationEvents to assert events published during tests
This commit introduces a new feature in the Spring TestContext
Framework (TCF) that provides support for recording application events
published in the ApplicationContext so that assertions can be performed
against those events within tests. All events published during the
execution of a single test are made available via the ApplicationEvents
API which allows one to process the events as a java.util.Stream.

The following example demonstrates usage of this new feature.

@SpringJUnitConfig(/* ... */)
@RecordApplicationEvents
class OrderServiceTests {

    @Autowired
    OrderService orderService;

    @Autowired
    ApplicationEvents events;

    @Test
    void submitOrder() {
        // Invoke method in OrderService that publishes an event
        orderService.submitOrder(new Order(/* ... */));
        // Verify that an OrderSubmitted event was published
        int numEvents = events.stream(OrderSubmitted.class).count();
        assertThat(numEvents).isEqualTo(1);
    }
}

To enable the feature, a test class must be annotated or meta-annotated
with @RecordApplicationEvents. Behind the scenes, a new
ApplicationEventsTestExecutionListener manages the registration of
ApplicationEvents for the current thread at various points within the
test execution lifecycle and makes the current instance of
ApplicationEvents available to tests via an @Autowired field in the
test class. The latter is made possible by a custom ObjectFactory that
is registered as a "resolvable dependency". Thanks to the magic of
ObjectFactoryDelegatingInvocationHandler in the spring-beans module,
the ApplicationEvents instance injected into test classes is
effectively a scoped-proxy that always accesses the ApplicationEvents
managed for the current test.

The current ApplicationEvents instance is stored in a ThreadLocal
variable which is made available in the ApplicationEventsHolder.
Although this class is public, it is only intended for use within the
TCF or in the implementation of third-party extensions.

ApplicationEventsApplicationListener is responsible for listening to
all application events and recording them in the current
ApplicationEvents instance. A single
ApplicationEventsApplicationListener is registered with the test's
ApplicationContext by the ApplicationEventsTestExecutionListener.

The SpringExtension has also been updated to support parameters of type
ApplicationEvents via the JUnit Jupiter ParameterResolver extension
API. This allows JUnit Jupiter based tests to receive access to the
current ApplicationEvents via test and lifecycle method parameters as
an alternative to @Autowired fields in the test class.

Closes gh-25616
2020-12-20 23:46:19 +01:00
Sam Brannen 65a395ef0e Fix syntax in Kotlin example 2020-12-19 15:29:40 +01:00
Juergen Hoeller 834032df1f Clarify intended advice execution behavior (includes related polishing)
Closes gh-26202
2020-12-07 22:06:22 +01:00
Brian Clozel 4337d8465c Remove spring.event.invoke-listener startup event
Prior to this commit, the `SimpleApplicationEventMulticaster` would be
instrumented with the `ApplicationStartup` and start/stop events for
invoking event listeners (`spring.event.invoke-listener`).

This feature was already limited to single-threaded event publishers,
but is still flawed since several types of events can happen
concurrently. Due to the single-threaded nature of the startup sequence,
our implementation should not produce startup events concurrently.

This can cause issues like gh-26057, where concurrent events lead to
inconcistencies when tracking parent/child relationships.

This commit removes the `spring.event.invoke-listener` startup event as
a result.

Fixes gh-26057
2020-12-03 15:40:31 +01:00
Arjen Poutsma a1320cd450 Add SSE support to WebMvc.fn
This commit adds support for sending Server-Sent Events in WebMvc.fn,
through the ServerResponse.sse method that takes a SseBuilder DSL.
It also includes reference documentation.

Closes gh-25920
2020-12-02 15:14:47 +01:00
Rossen Stoyanchev 1e19e51c9c Fix exchangeToMono sample in reference
Closes gh-26189
2020-12-01 17:46:12 +00:00
Sébastien Deleuze 43faa439ab Refine kotlinx.serialization support
This commit introduces the following changes:
 - Converters/codecs are now used based on generic type info.
 - On WebMvc and WebFlux, kotlinx.serialization is enabled along
   to Jackson because it only serializes Kotlin @Serializable classes
   which is not enough for error or actuator endpoints in Boot as
   described on spring-projects/spring-boot#24238.

TODO: leverage Kotlin/kotlinx.serialization#1164 when fixed.

Closes gh-26147
2020-11-26 12:36:35 +01:00
Rossen Stoyanchev 23006d417b Deprecate context method in WebClient
See gh-25710
2020-11-23 21:46:14 +00:00
Sam Brannen 4ed645e710 Fix broken links to XSD schemas in ref docs
Closes gh-26129
2020-11-23 14:49:43 +01:00
Brian Clozel de0b5bc5a1 Polish Kotlin code snippet in reference docs 2020-11-17 15:21:10 +01:00
Juergen Hoeller 2ee231dee2 Document that @Transactional does not propagate to new threads
Closes gh-25439
2020-11-17 14:43:17 +01:00
Juergen Hoeller b56dbd2aa8 Explicitly mention Jakarta Mail 1.6 next to JavaMail
See gh-25855
2020-11-17 14:42:41 +01:00
thanus 9139cb85bd Update javax.mail reference to jakarta.mail 2020-11-17 11:49:01 +01:00
Juergen Hoeller bc5a10c70d Document that Hibernate Search 5.11.6 is required for Spring JPA compatibility
Closes gh-26090
2020-11-16 19:51:50 +01:00
Rossen Stoyanchev c22a483c3d Update section on type conversion for web method arguments
Closes gh-26088
2020-11-16 17:01:57 +00:00
Sam Brannen 0819a9fcc9 Discover @DynamicPropertySource methods on enclosing test classes
gh-19930 introduced support for finding class-level test configuration
annotations on enclosing classes when using JUnit Jupiter @Nested test
classes, but support for @DynamicPropertySource methods got overlooked
since they are method-level annotations.

This commit addresses this shortcoming by introducing full support for
@NestedTestConfiguration semantics for @DynamicPropertySource methods
on enclosing classes.

Closes gh-26091
2020-11-15 20:59:15 +01:00
Arjen Poutsma 5338d8b5e9 Add cron expression documentation
This commit adds a section about the cron expression format supported by
 Spring.

Closes gh-26067
2020-11-12 15:57:14 +01:00
Rossen Stoyanchev 79f79e9306 WebClient method to populate the Reactor Context
The alternative is to use a filter but this makes it a little easier
and also guarantees that it will be downstream from all filters
regardless of their order, and therefore the Context will be visible
to all of them.

Closes gh-25710
2020-11-09 22:07:31 +00:00
Rüdiger Schulz 2214ff8ce0 Fix Kotlin example code which does not compile
This kotlin code does not compile:
Overload resolution ambiguity. All these functions match.
default <R> RowsFetchSpec<R> map(Function<Row, R> mappingFunction)
<R> RowsFetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);

Closes gh-26016
2020-11-08 15:43:30 +01:00
izeye b89b37729c Fix a broken Asciidoctor syntax in core-resources.adoc
See gh-25999
2020-10-30 09:32:42 +01:00
Aakarshit Uppal 44239b2d7b Remove rogue semicolon 2020-10-29 12:32:20 +00:00
Sam Brannen 9c2fd0bd05 Document @DynamicPropertySource use cases that require @DirtiesContext
Closes gh-25850
2020-10-27 14:26:40 +01:00
Sébastien Deleuze b2d337c527 Fix Coroutines minimal version in the refdoc
See gh-25969
2020-10-27 12:48:29 +01:00
Sam Brannen b01adadf60 Improve documentation for SpEL property reference syntax
See gh-25538
2020-10-27 11:48:44 +01:00
Yanming Zhou 9c11887fe8 Use lowercase property names in SpEL examples
Closes gh-25538
2020-10-27 11:48:44 +01:00
Sébastien Deleuze 3f01af6f7c Add kotlinx.serialization JSON support to Spring Messaging
Closes gh-25883
2020-10-26 20:10:54 +01:00
Juergen Hoeller d7f1813cd7 R2DBC and Hibernate documentation revision
Closes gh-25860
Closes gh-25533
2020-10-26 17:33:00 +01:00
Rossen Stoyanchev 1676470729 Merge branch '5.2.x' into master 2020-10-26 07:49:51 +00:00
Rossen Stoyanchev 4726663f81 Correct Javadoc link core-resources.adoc
Closes gh-25970
2020-10-26 07:43:30 +00:00
Rossen Stoyanchev 86af93a504 Correct sample in webmvc.adoc
Closes gh-25965
2020-10-26 07:40:33 +00:00
Sam Brannen b8b854db8c Discover @Sql annotations on enclosing class for nested test class
This commit introduces support for discovering @Sql, @SqlGroup,
@SqlConfig, and @SqlMergeMode on enclosing classes for @Nested test
classes in JUnit Jupiter.

Closes gh-25913
2020-10-22 17:08:10 +02:00
Jupiter 43f595f80e Wording changes. Fixed typo 'CorsConfiguraiton' 2020-10-19 14:17:23 +01:00
Rossen Stoyanchev d18fbab7a8 Heartbeat in lieu of non-broker destination message
Closes gh-22822
2020-10-19 13:06:30 +01:00
Rossen Stoyanchev a2ff139edd Resolve UriComponentsBuilder argument with contextPath
Closes gh-25822
2020-10-15 22:08:32 +01:00
Sam Brannen b79548d12e Add notes regarding enclosing test configuration inheritance
See gh-25912
2020-10-15 16:23:29 +02:00
Sam Brannen f9e11593a6 Document @NestedTestConfiguration support in reference manual
See gh-25912
2020-10-15 16:04:59 +02:00
Sam Brannen a924677b49 Document @NestedTestConfiguration support in reference manual
See gh-25912
2020-10-14 11:04:46 +02:00
Sam Brannen e5ae2cb0fe Support Propagation.NEVER for disabling test-managed transactions
Prior to this commit only Propagation.NOT_SUPPORTED was supported for
disabling test-managed transactions via the `propagation` attribute of
`@Transactional`.

This commit allows users to specify Propagation.NOT_SUPPORTED or
Propagation.NEVER to disable test-managed transactions.

Closes gh-25909
2020-10-13 18:30:50 +02:00
Sébastien Deleuze 3ed8813bbf Upgrade to Coroutines 1.4.0-M1 and use awaitSingle()
This commit raises the minimum Coroutines version supported
to 1.4.0-M1 and above, and changes usages of awaitFirst() or
awaitFirstOrNull() to awaitSingle() or awaitSingleOrNull()
to fix gh-25007.

Closes gh-25914
Closes gh-25007
2020-10-13 15:26:39 +02:00
xuxiang 66138f0dce
Fix a few typos in the web reference docs
Closes gh-25893

Co-authored-by: zhiyi.xx <zhiyi.xx@antfin.com>
2020-10-10 16:35:56 +02:00
Sébastien Deleuze 94a42a3086 Support suspending handler methods in Spring MVC
This commit adds support for Kotlin Coroutines suspending functions to
Spring MVC, by converting those to a Mono that can then be handled by
the asynchronous request processing feature.

It also optimizes Coroutines detection with the introduction of an
optimized KotlinDetector.isSuspendingFunction() method that does not
require kotlin-reflect.

Closes gh-23611
2020-10-09 12:25:32 +02:00
Sébastien Deleuze 7d7ed88739 Provide WebClient#exchange() alternative for Coroutines
This commit adds awaitExchange { } and
exchangeToFlow { } extensions as Coroutines variants for
exchangeToMono() and exchangeToFlux().

Closes gh-25751
2020-10-07 11:09:12 +02:00
Sébastien Deleuze 92b2c45281 Add kotlinx.serialization JSON support to Spring WebFlux
Flow decoding is not supported yet since it depends on
kotlin/kotlinx.serialization#1073, but it will be
enabled when this issue will be fixed.

Closes gh-25771
2020-10-06 23:02:33 +02:00
Brian Clozel a0af552d0f Add option for ignoring last-modified for static resources
Prior to this commit, the resource handler serving static resources for
Spring MVC and Spring WebFlux would always look at the
`Resource#lastModified` information, derive the `"Last-Modified"` HTTP
response header and support HTTP conditional requests with that
information.

In some cases, builds or packaging tools choose to set this last
modification date to a static date in the past. This allows tools to
have reproducible builds or to leverage caching given the static
resources content didn't change.

This can lead to problems where this static date (e.g. "1980-01-01") is
used literally in HTTP responses and will make the HTTP caching
mechanism counter-productive: the content of the resources changed, but
the application insists on saying it didn't change since the 80s...

This commit adds a new configuration option to disable this support -
there is no way to automatically discard those dates: there is no
standard for that and many don't use he "EPOCH 0 date" as it can lead to
compatibility issues with different OSes.

Closes gh-25845
2020-10-06 16:30:35 +02:00
Juergen Hoeller b7e1553c9d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java
2020-10-06 15:37:54 +02:00
Juergen Hoeller e417318915 Revise native Hibernate 5 bootstrapping with JTA transaction manager
Closes gh-25858
2020-10-06 15:31:19 +02:00
Arjen Poutsma 200b33b26a Add no path HTTP method variants for route builder
This commit adds two overloaded methods for each HTTP method in the
WebFlux.fn and WebMvc.fn route builders: one method taking just a
handler function, the other a request predicate and handler function.

After this commit, it is no longer required to provide a String path,
which is particularly useful when nesting routes, and the path would be
"".

Closes gh-25752
2020-10-06 11:00:17 +02:00
Arjen Poutsma 444c8185b6 Add document on async support in WebMvc.fn
This commit adds reference documentation about the support for
asynchronous types in WebMvc.fn.
2020-10-02 15:04:25 +02:00
Arjen Poutsma 8057fb38b2 DefaultPartHttpMessageReader reference docs
This commit changes the WebFlux reference documentation from the
SynchronossPartHttpMessageReader to the DefaultPartHttpMessageReader.

Closes gh-25827
2020-09-28 10:19:49 +02:00
Sam Brannen b34778d220 Polishing 2020-09-26 15:02:15 +02:00
Rossen Stoyanchev 52084ed954 Update WebFlux docs on logging with async appenders
Closes gh-25547
2020-09-25 21:44:35 +01:00
Rossen Stoyanchev 10c5f85a9f WebTestClient documentation updates
See gh-25751
2020-09-25 21:17:07 +01:00
Juergen Hoeller f89bd47188 Merge branch '5.2.x' 2020-09-25 12:52:56 +02:00
Juergen Hoeller d022fcf32f Explicit note on TransactionalEventListener versus reactive transactions
Closes gh-25805
2020-09-25 12:49:45 +02:00
Brian Clozel 687c3985d5 Fix merge-forward 2020-09-24 19:54:04 +02:00
Brian Clozel 6f04c7b60e Merge branch '5.2.x' 2020-09-24 18:11:32 +02:00
Sam Brannen a5a4960859 Do not generate reference docs for include-files
Prior to this commit, the Asciidoctor Gradle tasks generated top-level
HTML and PDF documents for AsciiDoc files that are included in other
top-level documents. This causes slower builds and results in each
include-file being published twice:

1) inline in the including document (as intended)
2) as a top-level document but missing surrounding context (unintended)

The reason these include-files are generated as top-level documents is
that the asciidoctor and asciidoctorPdf Gradle tasks are configured to
use '*.adoc' as the input source files.

This commit addresses this issue by moving the following include-files
to new subdirectories. Locating the include-files in the subdirectories
causes them to be ignored in the '*.adoc' pattern used to identify
input source files.

- data-access-appendix.adoc -> data-access/data-access-appendix.adoc
- integration-appendix.adoc -> integration/integration-appendix.adoc
- testing-webtestclient.adoc -> testing/testing-webtestclient.adoc

Closes gh-25783
2020-09-21 11:51:50 +02:00
Sam Brannen 87399aedf7 Do not generate reference docs for include-files
Prior to this commit, the Asciidoctor Gradle tasks generated top-level
HTML and PDF documents for AsciiDoc files that are included in other
top-level documents. This causes slower builds and results in each
include-file being published twice:

1) inline in the including document (as intended)
2) as a top-level document but missing surrounding context (unintended)

The reason these include-files are generated as top-level documents is
that the asciidoctor and asciidoctorPdf Gradle tasks are configured to
use '*.adoc' as the input source files.

This commit addresses this issue by moving the following include-files
to new subdirectories. Locating the include-files in the subdirectories
causes them to be ignored in the '*.adoc' pattern used to identify
input source files.

- data-access-appendix.adoc -> data-access/data-access-appendix.adoc
- integration-appendix.adoc -> integration/integration-appendix.adoc
- testing-webtestclient.adoc -> testing/testing-webtestclient.adoc

Closes gh-25783
2020-09-19 14:54:27 +02:00
Sam Brannen e58e33606a Polish WebTestClient ref docs and fix example 2020-09-18 15:33:54 +02:00
Andreas Ahlenstorf cd6085a310 Add kotlinx.serialization JSON support to Spring MVC
Closes gh-21188

Co-authored-by: Sebastien Deleuze <sdeleuze@vmware.com>
2020-09-14 23:25:16 +02:00
Juergen Hoeller 07b3e92bae Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	src/docs/asciidoc/core/core-aop-api.adoc
2020-09-14 22:22:02 +02:00
Juergen Hoeller 3c84863271 Polishing 2020-09-14 22:18:30 +02:00
Ruslan Stelmachenko 3b0f14fd2e
Fix typo in Regular Expression Pointcuts docs
Closes gh-25767
2020-09-14 21:01:13 +02:00
Sokrato 4dfecde694 fix core doc English regarding @AspectJ 2020-09-14 10:20:31 +01:00
xuxiang f37e0c6a1b
Fix typo regarding Ordered interface in core-aop.adoc
Closes gh-25759
2020-09-12 13:57:11 +02:00
Brian Clozel 078543ce67 Deprecate Joda time support
This commit deprecates the Joda time support and schedules it for
removal in 6.0.

Closes gh-25736
2020-09-08 14:46:48 +02:00
Rossen Stoyanchev dd011c991c Merge branch '5.2.x' into master 2020-09-07 21:41:30 +01:00
Rossen Stoyanchev 94c91c9e9c Explain how to provide serialization view programmatically
Closes gh-25596
2020-09-07 21:27:52 +01:00
Juergen Hoeller 9d7849c539 Merge branch '5.2.x'
# Conflicts:
#	spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
2020-09-05 13:02:01 +02:00
Juergen Hoeller 939c76c4a5 Revise documentation notes on getParameterType performance issues
See gh-25679
2020-09-05 13:00:06 +02:00
Rossen Stoyanchev e34c800467 More updates to Web testing section
See gh-19647
2020-09-01 08:56:57 +01:00
Rossen Stoyanchev c6b87b3ef4 Updates to Web testing sections of reference docs
Closes gh-19647
2020-08-31 21:15:17 +01:00
Rossen Stoyanchev 591ab8a00a @EnableWebFlux setup supports WebSocketHandler
Closes gh-22587
2020-08-31 21:15:17 +01:00
Rossen Stoyanchev 7bc8035989 Replace http with https in docs sample 2020-08-28 22:30:57 +01:00
Rossen Stoyanchev 42aeb6cd93 Update docs on timeouts with WebClient
Closes gh-25115
2020-08-28 22:19:01 +01:00
Oleksii Klochko 7205edac85
Fix typo in websocket.adoc
Closes gh-25630
2020-08-22 22:56:36 +02:00
York Lee 36553264ce Fix document for core-bean.adoc
This is the orginal "A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container". Here's an extra word of "otherwise".
2020-08-14 11:04:27 +01:00
Sam Brannen 2c757399b2 Polish spring-jcl documentation 2020-08-11 11:58:49 +02:00
Vitalii Ananev 890f29e832 Add spring-jcl information to reference doc
Closes gh-22158
2020-08-10 16:52:45 +02:00
Sam Brannen 1dcaa04224 Fix typo in reference manual 2020-08-10 12:22:06 +02:00
diguage 2c274cf0aa Use Groovy syntax highlighting in reference manual
Closes gh-25554
2020-08-10 12:11:03 +02:00
diguage 0501999e43 Fix comment syntax in xml examples
See gh-25537
2020-08-06 14:25:30 +02:00
Stephane Nicoll 6d164b1445 Merge branch '5.2.x' 2020-08-06 09:30:17 +02:00
diguage 5cb2cc2466 Fix asciidoctor syntax for source
See gh-25539
2020-08-06 09:27:09 +02:00
diguage e150a95685 Fix comment syntax in xml examples
See gh-25537
2020-08-06 09:10:10 +02:00
Rossen Stoyanchev 683cc2eb7f Add NDJSON and deprecate application/stream+json
Closes gh-21283
2020-07-28 17:53:37 +03:00
Brian Clozel 9301d7a294 Add application startup metrics support
This commit adds a new `StartupStep` interface and its factory
`ApplicationStartup`. Such steps are created, tagged with metadata and
thir execution time can be recorded - in order to collect metrics about
the application startup.

The default implementation is a "no-op" variant and has no side-effect.
Other implementations can record and collect events in a dedicated
metrics system or profiling tools. We provide here an implementation for
recording and storing steps with Java Flight Recorder.

This commit also instruments the Spring application context to gather
metrics about various phases of the application context, such as:

* context refresh phase
* bean definition registry post-processing
* bean factory post-processing
* beans instantiation and post-processing

Third part libraries involved in the Spring application context can
reuse the same infrastructure to record similar metrics.

Closes gh-24878
2020-07-27 22:37:14 +02:00
Jay Bryant 674bad0c59 Wording changes
Replace potentially insensitive language with more neutral language.

See gh-25314
2020-07-20 20:08:54 +02:00
Sam Brannen 3d64f8162c Merge branch '5.2.x' 2020-07-20 18:38:32 +02:00
Jay Bryant 1c83b3fc22 Wording changes
Replace potentially insensitive language with more neutral language.

Closes gh-25314
2020-07-20 17:14:13 +02:00
Sam Brannen b0570cd3a6 Polish contribution
See gh-25367
2020-07-16 15:56:17 +02:00
Martin Knopf 35c0ae7b0c Allow auto grow for entries w/o default constructor in SpEL
Prior to this commit, The "auto grow" feature in SpEL expressions only
worked for element types with a default constructor. For example, auto
grow did not work for a list of BigDecimal elements.

This commit inserts a null value in the list when no default
constructor can be found for the element type.

Closes gh-25367
2020-07-16 15:31:33 +02:00
Rossen Stoyanchev 7c98251142 Support for making requests via RSocketClient
Closes gh-25332
2020-07-14 12:07:59 +03:00
Brian Clozel d9ccd618ea Deprecate remoting technologies support
Because of security and broader industry support, support for several
remoting technologies is now deprecated and scheduled for removal in
Spring Framework 6.0.

This commit deprecates the following remoting technologies:

* HTTPInvoker
* RMI
* Hessian
* JMS remoting

Other remoting technologies like EJB or JAXWS might be deprecated in the
future depending on industry support.

Closes gh-25379
2020-07-10 12:04:24 +02:00
Sam Brannen c972d861ed Revert "Use correct link to MaxInMemorySize"
This reverts commit 90467ba568.
2020-07-08 15:25:46 +02:00
Johnny Lim 90467ba568
Use correct link to MaxInMemorySize
Closes gh-25368
2020-07-08 15:05:24 +02:00
Rossen Stoyanchev 0e4e25d227 Updates to CORS patterns contribution
Closes gh-25016
2020-07-08 13:18:46 +03:00
Sam Brannen 882668c1bc Merge branch '5.2.x' 2020-07-06 16:33:01 +02:00
Sam Brannen 8734c64b75 Remove invalid import from Kotlin example 2020-07-06 16:31:33 +02:00
Sam Brannen 8be2a43d52 Rename SystemArchitecture aspect to CommonPointcuts in AOP ref doc
See gh-25357
2020-07-06 16:20:05 +02:00
Sam Brannen 33643593e2 Merge branch '5.2.x' 2020-07-06 14:51:15 +02:00
Sam Brannen 52c2ca610b Polish AOP reference documentation
- fix formatting
- fix syntax
- use consistent example package name
2020-07-06 14:50:44 +02:00
Sam Brannen 85a46882ce Merge branch '5.2.x' 2020-07-02 15:29:32 +02:00
Maksim 008a0a1bdd Fix interface and class names in examples in core-aop doc
Closes gh-25351
2020-07-02 15:28:05 +02:00
Sam Brannen f9331d921f Merge branch '5.2.x' 2020-06-23 17:10:33 +02:00
DK Lee 6419b18bee Fix typo in Java example for handler class
Closes gh-25302
2020-06-23 16:46:14 +02:00
Juergen Hoeller 9e12a20324 Polishing 2020-06-23 11:35:22 +02:00
Kamil Szymanski 23aeba0e46 Fix typos in WebRequest.checkNotModified docs
Closes gh-1035
2020-06-23 09:45:07 +02:00
Sam Brannen bf5033281b Merge branch '5.2.x' 2020-06-22 11:38:50 +02:00
Sam Brannen 80d1aaec0c Add spring-r2dbc and spring-rsocket to Stack Overflow tags 2020-06-22 11:38:04 +02:00
Sam Brannen 01fa923e96 Merge branch '5.2.x' 2020-06-21 19:42:43 +02:00
Sam Brannen 0a208a4941 Fix broken link to Stack Overflow tags 2020-06-21 19:41:56 +02:00
Juergen Hoeller 3a653bd35f Deprecate JCA CCI support
Closes gh-25287
2020-06-19 19:19:14 +02:00
Rossen Stoyanchev ce728a6c4b Update docs for PathPattern support in WebMvc
Closes gh-24945
2020-06-18 21:16:43 +01:00
Sam Brannen dc3801043f Merge branch '5.2.x' 2020-06-18 14:55:02 +02:00
Sam Brannen 46c786167e Replace "blacklist" with alternative words
See gh-25262
2020-06-18 14:54:33 +02:00
Mark Paluch aff601edf1 Add support for R2DBC
This commit introduces support for R2DBC ("Reactive Relational Database
Connectivity") with custom ConnectionFactory implementations, a
functional DatabaseClient for SQL execution, transaction management, a
bind marker abstraction database initialization utilities, and
exception translation.

Closes gh-25065
2020-06-17 19:29:48 +02:00
Mark Paluch 217b6e37a6 Rollback reactive transaction on cancel
This commit introduces a change in reactive transaction semantics for
cancel signals. Canceling a subscription now rolls back a reactive transaction
to achieve a deterministic transaction outcome.

Previously, cancel signals committed a transaction which could
cause partially committed transactions depending on when the cancel happened.
2020-06-17 15:04:54 +02:00
Sam Brannen 8853f4b883 Merge branch '5.2.x' 2020-06-17 14:47:53 +02:00
Sam Brannen d51abe462e Upgrade to nohttp 0.0.5
Closes gh-25266
2020-06-17 14:46:23 +02:00
Sam Brannen 775d99ac78 Merge branch '5.2.x' 2020-06-17 14:23:27 +02:00
Sam Brannen 9acb5b1a4a Replace "black box" with alternative term
See gh-25262
2020-06-17 14:22:26 +02:00
Sam Brannen 77dd05853c Polishing 2020-06-17 13:35:14 +02:00
Juergen Hoeller d36407d585 Deprecate rarely used bean definition variants
Closes gh-24875
2020-06-17 10:59:55 +02:00
Sam Brannen bb7e5f0172 Merge branch '5.2.x' 2020-06-15 14:59:30 +02:00
wonwoo fd7e6486de Fix syntax in validation examples
Closes gh-25251
2020-06-15 14:58:27 +02:00
Rossen Stoyanchev 1984cfe9d7 Merge branch '5.2.x' 2020-06-08 21:20:44 +01:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01:00
Sam Brannen edbc54fe78 Merge branch '5.2.x' 2020-06-08 19:17:01 +02:00
Sam Brannen 721fd20708 Document advice precedence in reference manual
This commit documents the precedence for advice declared within the
same @Aspect class or within the same <aop:aspect> element.

See gh-25186
2020-06-08 19:06:46 +02:00
Sam Brannen 0b760c15ea Polish AOP chapter in reference manual 2020-06-08 19:06:46 +02:00
Rossen Stoyanchev 150fe96a98 Merge branch '5.2.x' 2020-06-08 17:44:42 +01:00
Rossen Stoyanchev 9e1121fd8d Document behavior on reactive tx cancellation
Closes gh-25091
2020-06-08 17:43:52 +01:00
Juergen Hoeller 5051d7302d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/main/java/org/springframework/http/HttpHeaders.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
2020-06-06 15:27:15 +02:00
Juergen Hoeller 196bb6fe32 Support for shared GroovyClassLoader in GroovyScriptFactory
Exposes setClassLoader method in ConfigurableApplicationContext interface as obvious first-class configuration option.

Closes gh-25177
2020-06-06 13:21:20 +02:00
Martin Macko e11da64e9c
Fix obsolete link in Kotlin docs
Closes gh-25192
2020-06-05 14:12:38 +02:00
Sam Brannen cc061ca716 Merge branch '5.2.x' 2020-05-27 16:30:22 +02:00
Sam Brannen 3cbc297fc6 Polish contribution
See gh-25137
2020-05-27 16:29:34 +02:00
limo520 d6cab259c3 Fix URI pattern example in webflux.adoc
Closes gh-25137
2020-05-27 16:14:47 +02:00
Juergen Hoeller 9999414b3b Merge branch '5.2.x' 2020-05-18 14:24:33 +02:00
Juergen Hoeller 28177ad91b Explicit notes on access to standard context beans in SpEL expressions
Closes gh-25037
2020-05-18 14:19:05 +02:00
Yanming Zhou 9d429e30de Fix SpelEvaluationException with example code
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'name' cannot be found on null
2020-05-18 14:16:15 +02:00
Brian Clozel 567265123b Avoid using regex matching for static patterns
Prior to this commit (and the previous one), the `AntPathStringMatcher`
(inner class of `AntPathmatcher`) would compile `Pattern` instances and
use regex matching even for static patterns such as `"/home"`.

This change introduces a shortcut in the string matcher algorithm to
skip the `Pattern` creation and uses `String` equality instead.
Static patterns are quite common in applications and this change can
bring performance improvements, depending on the mix of patterns
configured in the web application.

In benchmarks (added with this commit), we're seeing +20% throughput
and -40% allocation. This of course can vary depending on the number of
static patterns configured in the application.

Closes gh-24887
2020-05-15 17:07:58 +02:00
Rossen Stoyanchev b1224835be Add metadataPush support to RSocketRequester
Closes gh-24322
2020-05-14 15:42:43 +01:00
Brian Clozel 67547e61c6 Add JMH benchmark infrastructure
Prior to this commit, the Spring Framework test suite would rely only on
"Performance" tests associated with a specific CI build. As outlined in
gh-24830, the way they're built and executed is not working well
anymore.

This commit introduces a new JMH benchmark infrastructure in the build.
The goal here is not to run those benchmarks as part of a CI build, but
rather provide a proper infrastructure for writing and locally running
micro-benchmarks when working on specific optimizations.

This commit adds and configures a Gradle JMH plugin to allow for JMH
benchmark classes in Spring Framework modules (in `src/jmh/java` of each
`spring-*` module). It's also relaxing the checkstyle rules for JMH
classes, especially around Javadoc rules: this code is not meant to
have Javadocs.

Finally, this commit links to a new Wiki page on the project GitHub
repository documenting the infrastructure and helping contributors to
run and design benchmarks.

See gh-24830
2020-05-13 21:29:02 +02:00
Rossen Stoyanchev a64e7091e0 Deprecate support for RxJava 1.x
Closes gh-19628
2020-05-11 08:48:48 +01:00
stqp 73e3df5df5
Fix typo in core-beans.adoc
Closes gh-25040
2020-05-09 14:06:45 +02:00
Sam Brannen 8f7debc769 Merge branch '5.2.x' 2020-05-08 19:26:00 +02:00
Sam Brannen 0f22a5e409 Update Javadoc regarding reactive tx mgmt support
See gh-25030
2020-05-08 19:25:22 +02:00
Sam Brannen 1e64ffa7ba Merge branch '5.2.x' 2020-05-08 18:19:17 +02:00
Sam Brannen e1b2cafb33 Polish reactive transaction mgmt documentation in reference manual
See gh-25030
2020-05-08 18:13:31 +02:00
Mark Paluch 7fbdc3ad11 Document ReactiveTransactionManager support in reference manual
See gh-25030.
2020-05-08 16:11:02 +02:00
Sam Brannen 21800a5fa6 Polish @Transactional documentation in reference manual 2020-05-07 18:42:02 +02:00
Yanming Zhou 247662de6b
Fix @Transactional syntax error in reference manual
Closes gh-25021
2020-05-07 18:10:50 +02:00
Mark Paluch 2aa8aef216 Extend transaction attributes with labels
TransactionAttribute now exposes a labels attribute that associates a
descriptive array of labels with a transaction.

Labels may be of a pure descriptive nature or may get evaluated by
transaction managers to associate technology-specific behavior
with the actual transaction.
2020-05-06 16:28:21 +02:00
Rossen Stoyanchev 3e736898a6 Merge branch '5.2.x' 2020-05-06 14:31:58 +01:00
Rossen Stoyanchev 53e018362f Update samples to latest RSocket API
A follow-up fix on the upgrade to 1.0 RC7 in gh-24934,
2020-05-06 14:28:18 +01:00
Rossen Stoyanchev 147b8fb755 Turn off use of path extensions by default
Closes gh-23915
2020-05-05 08:04:40 +01:00
Rossen Stoyanchev 153690e717 Merge branch '5.2.x' 2020-05-04 10:55:25 +01:00
swapy 9288067ea8 Add missing @PathVariable declarations in examples
Closes gh-25006
2020-05-04 11:19:19 +02:00
Sam Brannen 1b4b4c3302 Support @TestConstructor config via JUnit Platform config param
This commit introduces support for setting the
spring.test.constructor.autowire.mode property via a JUnit Platform
configuration parameter -- for example, via the
junit-platform.properties file.

Closes gh-24285
2020-05-03 19:02:44 +02:00
Sam Brannen 69b4f33cfa Move spring-framework.png to src/docs folder
Since the spring-framework.png file is not used in the generated
reference manual, this commit moves the spring-framework.png file from
the src/docs/asciidoc/images folder up to the src/docs folder.
2020-04-29 16:25:02 +02:00
Sam Brannen 48d06a4291 Prune images folder for reference manual
This commit deletes unused files in the asciidoc/images folder.
2020-04-29 16:21:07 +02:00
martin-tarjanyi 3bc1d42dcd Integrate Apache http client with WebClient
This commit introduces a ClientHttpConnector implementation backed by
Apache HttpComponents HttpClient 5.0.

Fixes gh-24700
2020-04-29 15:02:09 +02:00
rahulmlokurte 0e9da17910
Fix typo in webmvc-functional.adoc
Closes gh-24968
2020-04-25 09:24:15 +02:00
Brian Clozel dc4cda1b13 WARN against invalid patterns with PathPatternParser
As of gh-24952, `PathPatternParser` will strictly reject patterns with
`"**"` in the middle of them. `"**"` is only allowed at the end of the
pattern for matching multiple path segments until the end of the path.

Currently, if `"**"` is used in the middle of a pattern it will be
considered as a single `"*"` instead. Rejecting such cases should
clarify the situation.

This commit prepares for that upcoming change and:

* logs a warning message if such a case is used by an application
* expands the MVC and WebFlux documentation about URI matching in
general

Closes gh-24958
2020-04-23 13:03:05 +02:00
Brian Hartung 1658223e58 Fixed typo
Fixed another small documentation typo.
2020-04-15 14:20:35 +01:00
Brian Hartung 89775844ed Fixed typos
Fixed a couple of minor documentation typos
2020-04-15 14:20:35 +01:00
onnadi-sa 75457c440c
Fix typo in webflux-functional.adoc
Closes gh-24906
2020-04-14 15:42:50 +02:00
Sam Brannen 6c26765985 Document default constructor as fallback for non-@Autowired constructors
Prior to this commit, it was unclear in the documentation that a default
constructor will be used by default for autowiring if multiple
constructors are present and none of them is annotated with @Autowired.

This commit improves the documentation in this regard.

Closes gh-24838
2020-04-07 14:35:40 +02:00
Juergen Hoeller 151a18d691 Explicit notes on BeanFactory.getType vs bean class in bean definition
Closes gh-24816
2020-04-03 21:11:07 +02:00
Sam Brannen a842434bff Document precedence for @DynamicPropertySource
Closes gh-24837
2020-04-01 18:09:31 +02:00
Rossen Stoyanchev 99c2b1e242 Add snippet for maxInMemorySize config
See gh-23961
2020-03-31 17:08:12 +01:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Taehee Kim 8b3521d2bf
Fix typo in webflux-cors.adoc
Closes gh-24815
2020-03-30 14:00:25 +02:00
Mikael Elm 822ca0130a
Fix typos and improve readability in Webflux documentation
Closes gh-24781
2020-03-26 15:16:22 +01:00
Arjen Poutsma 9fb614a5c6 Clarify the role of views with Spring MVC
This commit adds a section to the reference docs that explains
views live within the trust boundary of the application, and the
security implications thereof.

Closes gh-24777
2020-03-25 15:05:50 +01:00
Sam Brannen c24fa22a1b Polishing 2020-03-24 14:22:42 +01:00
Sam Brannen 4be358e47f Cross reference Dynamic Property Sources section 2020-03-24 14:07:56 +01:00
Sébastien Deleuze 1cd0e720f7 Specify that Kotlin code samples leverage kotlin-allopen 2020-03-24 10:31:57 +01:00
Sébastien Deleuze 60dca027e7 Add Kotlin documentation and tests for @DynamicPropertySource
See gh-24540
2020-03-24 10:08:37 +01:00
Sam Brannen ac0363c94e Document @DynamicPropertySource support in the reference manual
Closes gh-24540
2020-03-23 20:43:38 +01:00
Sam Brannen a90716522c Include Testcontainers in Further Resources section 2020-03-23 20:05:58 +01:00
Juergen Hoeller bb1699a9d3 Revise documentation for autowiring with annotated constructors
Closes gh-24711
2020-03-23 18:01:30 +01:00
Sam Brannen 5be0db9259 Consistently refer to `t_actor` table 2020-03-22 20:32:45 +01:00
Sam Brannen b52136dfa5 Revert renaming of local variable
This commit fixes the example by reverting the renaming of the local
Actor variable to avoid a conflict with a same-named variable already
in the current scope.

See gh-24398
2020-03-22 20:28:59 +01:00
Sam Brannen edb5e73d48 Update Kotlin example based on feedback from @lnhrdt
See gh-24398
2020-03-18 15:34:27 +01:00
Sam Brannen 14f5032e97 Update Kotlin example
See gh-gh-24398
2020-03-17 19:22:26 +01:00
Sam Brannen 7dea2686b8 Polish contribution
See gh-24398
2020-03-17 15:06:10 +01:00
maxxedev 9b827283f1 Use more lambda expressions in data-access code examples
Closes gh-24398
2020-03-17 15:06:03 +01:00
Sviatoslav Hryb 018ba92214 Fix formatting in AOP examples in documentation 2020-03-09 14:44:41 +00:00
Sviatoslav Hryb f5195887c9 Fix ampersands in AOP examples in documentation 2020-03-09 13:27:55 +00:00
Qimiao Chen 7ce22e2f3a
Update IntroductionInfo example in reference manual
Closes gh-24650
2020-03-06 12:34:00 +01:00
Rossen Stoyanchev e1b0296f9e Polishing contribution
See gh-24589
2020-03-03 15:38:47 +00:00
陈其苗 771fbde951 Fix URL to Spring Tool Suite
See gh-24589
2020-03-03 15:38:47 +00:00
Yoo In Keun e706fcba1f
Fix typo in testing.adoc
Closes gh-24627
2020-03-02 16:25:28 +01:00
Sviatoslav Hryb 60fd95a354
Fix formatting for pointcut expression examples in documentation
Closes gh-24621
2020-03-02 13:42:09 +01:00
Andreas Volkmann b30f9a1308 Fix typo in core-aop.adoc
Closes gh-24602
2020-02-26 18:33:25 +00:00
Florian Berger d4de3396f7 Fix typo about URI Encoding in docs
Closes gh-24603
2020-02-26 18:28:52 +00:00
wonwoo 5c2d65b8ef
Fix typo in reference manual
Closes gh-24597
2020-02-26 14:34:25 +01:00
Qimiao Chen 8cf70fe509
Improve documentation for @Autowired/@Value in @Configuration classes
Closes gh-24585
2020-02-25 11:01:19 +01:00
Rossen Stoyanchev 7e402ba4fe Improve docs on date and time formatting
Closes gh-24370
2020-02-24 19:05:09 +00:00
Qimiao Chen 1de2e0a4a7
Fix formatting in webflux-webclient.adoc
Closes gh-24578
2020-02-24 15:00:11 +01:00
Rossen Stoyanchev 96e77d417b Update WebFlux section on HTTP/2
Closes gh-24558
2020-02-20 16:28:22 +00:00
Sviatoslav Hryb 2ad4602ca0
Correct Ant-style Patterns example in documentation
Closes gh-24552
2020-02-19 10:51:16 +01:00
Rossen Stoyanchev df1145b797 Correct documentation error in section on BeanWrapper
Closes gh-24510
2020-02-18 09:44:04 +00:00
Sviatoslav Hryb 9e7ab4d308
Correct formatting of MessageSource example in documentation
Closes gh-24531
2020-02-17 15:25:17 +01:00
Rossen Stoyanchev e35d3b8bb5 Update advice on RestTemplate
Closes gh-24503
2020-02-11 14:02:50 +00:00
Andy Wilkinson 02e90a8645
Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
0.4.0 provides built-in support for remembering a user's selections
using local storage. This replaces the custom switch language
JavaScript.

The selection is stored using a key derived from the
options that were available. Concretely, when the options are Java or
Kotlin, the local storage key is java-kotlin. Similarly, if the
choices were Java, Kotlin, and XML, the key would be java-kotlin-xml.

Given local storage's domain and protocol scoping, the nature of the
key that's used for storage will allow a user's selections to be
applied across all documentation hosted on https://docs.spring.io that
offer the same options.

Closes gh-24481
2020-02-07 12:16:02 +01:00
Christoph Dreis 15b651cdfe Polish documentation format
See gh-24460
2020-01-31 08:55:52 +01:00
Sam Brannen 2c86d6ded2 Polishing 2020-01-28 10:50:15 +01:00
Sviatoslav eeaae16b17 Remove dated mention of "local" bean attribute
Closes gh-24430
2020-01-27 17:47:48 +00:00
Anton c1218615df Update integration.adoc
Fix typo
2020-01-27 16:21:16 +00:00
Rob Winch ab70acb325 Fix Additional Asciidoctor Warnings
Fix "unknown style for example block: INFO"

Issue gh-24427
2020-01-24 09:29:13 -06:00
Sam Brannen 75a1395226 Link to BeanShell homepage 2020-01-24 16:20:02 +01:00
Rob Winch 754a8ca05a Fix Asciidoctor Warnings
- Fix "possible invalid reference" errors
  - Add <filename>.adoc where necessary
  - Remove invalid link to beans-servicelocator This section no longer exists
- Fix "skipping reference to missing attribute" errors
  - Add pass macro to escape literals interpreted as attributes
  - Add missing :api-spring-framework: attribute
  - Remove invalid {JB} attribute

Closes gh-24427
2020-01-24 09:14:07 -06:00
Juergen Hoeller 60c7af3625 Mention HikariCP next to DBCP and C3P0 in connection pool notes
Closes gh-24405
2020-01-24 14:54:02 +01:00
Rossen Stoyanchev c69703ffdb Deprecate path extension strategies
This commit deprecates PathExtensionContentNegotiationStrategy and
ServletPathExtensionContentNegotiationStrategy and also updates code
that depends on them internally to remove that dependence.

See gh-24179
2020-01-22 13:35:09 +00:00
Rossen Stoyanchev 3d33cf3764 Updates to Validation section in reference
Closes gh-24338
2020-01-16 15:42:28 +00:00
Sam Brannen 3b983e2165 Include Objenesis NOTICE file contents in binary distributions
Closes gh-24326
2020-01-15 14:18:30 +01:00
Sam Brannen 152254ab0a Document supported characters for identifiers in SpEL expressions
Closes gh-24359
2020-01-15 13:53:22 +01:00
Rossen Stoyanchev 8740c2dc18 Warning against split URL handling in docs
Closes gh-24304
2020-01-13 21:33:11 +00:00
Sam Brannen 850cbf032b Document Objenesis license in license.txt
Closes gh-24340
2020-01-13 14:42:04 +01:00
Sam Brannen a566083a07 Update ASM and CBLIB versions in license.txt 2020-01-13 13:16:50 +01:00
Sam Brannen e3e7d90415 Improve documentation for FullyQualifiedAnnotationBeanNameGenerator
See gh-24114
2020-01-08 16:47:39 +01:00
Rossen Stoyanchev 68f9f8116c Fix typo in RSocket reference
See gh-24245
2020-01-03 08:11:14 +00:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Honnix 8082b338e2 Document that SpEL supports symbolic logical operators
Make it clear that symbolic logical operators are supported.

Closes gh-24276
2019-12-31 18:58:48 +01:00
Ferdinand Jacobs 0b5ad09394 Fix example in RSocket docs
Closes gh-24245
2019-12-22 16:48:58 +01:00
Rossen Stoyanchev dd9b6287b4 Expose ClientCodecConfigurer in WebClient.Builder
Using Consumer<ClientCodecConfigurer> instead of
Consumer<ExchangeStrategies> eliminates one level of nesting that is
also unnecessary since codecs are the only strategy at present.

Closes gh-24124
2019-12-12 21:58:14 +00:00
Rossen Stoyanchev 70a0c93d69 Correct WebFlux docs on BindingResult with @RequestBody
Closes gh-22997
2019-12-10 16:01:33 +00:00
Sam Brannen de8a6c8c57 Polishing 2019-12-06 19:08:54 +01:00
Eric Helgeson d4d940e6e3 Add missing backtick in WebSocket documentation
Closes gh-24155
2019-12-06 19:02:22 +01:00
Johnny Lim 14ce84cebb Fix status code in webflux.adoc 2019-12-05 12:25:04 +00:00
Rossen Stoyanchev 828fe39523 Consistently use releaseBody in DefaultWebClient
See gh-24125
2019-12-04 18:19:52 +00:00
Rossen Stoyanchev 797f618f2b Remove mismatched marker in core-beans.adoc
Closes gh-24132
2019-12-04 16:14:14 +00:00
Brian Clozel decbb9ccf9 Provide default codecs config callback to custom codecs
As a follow-up of gh-23961, this change provides a way for custom codecs
to align with the default codecs' behavior on common features like
buffer size limits and logging request details.

Closes gh-24118
Co-authored-by: Rossen Stoyanchev <rstoyanchev@pivotal.io>
2019-12-02 22:52:55 +01:00
Wang Xuesong d1ab81587c [*.*] is displayed as [bold .] and needs to be escaped
execution(* com.xyz.service.*.*(..))  ->  execution(* com.xyz.service.\*.*(..))

Closes gh-24108
2019-12-02 19:14:18 +01:00
Rossen Stoyanchev acfeb77d41 Polishing
See gh-23961
2019-12-02 14:12:59 +00:00
Brian Clozel d4209392d2 Allow ExchangeStrategies customizations in WebClient
Prior to this commit, developers could configure their WebClient to use
their custom `ExchangeStrategies`, by providing it in the
`WebClient.Builder` chain.
Once created, an `ExchangeStrategies` instance is not mutable, which
makes it hard for further customizations by other components. In the
case of the reported issue, other components would override the default
configuration for the codecs maxInMemorySize.

This commit makes the `ExchangeStrategies` mutable and uses that fact to
further customize them with a new `WebClient.Builder#exchangeStrategies`
`Consumer` variant. This commit is also deprecating those mutating
variants in favor of a new `WebClient.Builder#exchangeStrategies` that
takes a `ExchangeStrategies#Builder` directly and avoids mutation issues
altogether.

Closes gh-23961
2019-12-02 14:12:59 +00:00
Brian Clozel 1560bbd81e Revert "Allow ExchangeStrategies customizations in WebClient"
This reverts commit b3020bc484.
2019-12-02 10:39:53 +01:00
Brian Clozel b3020bc484 Allow ExchangeStrategies customizations in WebClient
Prior to this commit, developers could configure their WebClient to use
their custom `ExchangeStrategies`, by providing it in the
`WebClient.Builder` chain.
Once created, an `ExchangeStrategies` instance is not mutable, which
makes it hard for further customizations by other components. In the
case of the reported issue, other components would override the default
configuration for the codecs maxInMemorySize.

This commit makes the `ExchangeStrategies` mutable and uses that fact to
further customize them with a new `WebClient.Builder#exchangeStrategies`
`Consumer` variant. This commit is also deprecating those mutating
variants in favor of a new `WebClient.Builder#exchangeStrategies` that
takes a `ExchangeStrategies#Builder` directly and avoids mutation issues
altogether.

Closes gh-23961
2019-11-29 22:26:52 +01:00
Sam Brannen d7023fd02b Delete unused JdbcTemplate fields in examples
Closes gh-24085
2019-11-29 19:01:42 +01:00
Sam Brannen 52a1fc4329 Polish BatchPreparedStatementSetter example in reference manual
Closes gh-24084
2019-11-29 18:50:42 +01:00
Sam Brannen 5648ef3276 Fix examples for <tx:method/> settings in reference manual
Closes gh-24080
2019-11-29 18:41:59 +01:00
Sam Brannen 093323beeb Introduce Checkstyle rule to prohibit class names ending with "Test" 2019-11-29 17:30:29 +01:00
Rossen Stoyanchev 25f3465f1f Polishing contribution
See gh-24087
2019-11-29 15:53:37 +00:00
ryenus 40331eaca3 Fix consecutive-word duplications in documentation
See gh-24089
2019-11-27 09:42:44 +01:00
Rossen Stoyanchev 5a552f1670 Update links between WebFlux and Web MVC 2019-11-26 21:50:01 +00:00
Rossen Stoyanchev f4e0288357 Remove mentions of Tomcat async request timeout value
Close gh-24030
2019-11-19 17:08:43 +00:00
Rossen Stoyanchev 842b424acd Use method signature to refine RSocket @MessageMapping
Before this change an @MessageMapping could be matched to any RSocket
interaction type, which is arguably too flexible, makes it difficult to
reason what would happen in case of a significant mismatch of
cardinality, e.g. request for Fire-And-Forget (1-to-0) mapped to a
method that returns Flux, and could result in payloads being ignored,
or not seen unintentionally.

This commit checks @ConnectMapping method on startup and rejects them
if they return any values (sync or async). It also refines each
@MessageMapping to match only the RSocket interaction type it fits
based on the input and output cardinality of the handler method.
Subsequently if a request is not matched, we'll do a second search to
identify partial matches (by route only) and raise a helpful error that
explains which interaction type is actually supported.

The reference docs has been updated to explain the options.

Closes gh-23999
2019-11-18 17:27:41 +00:00
denisgalaybo 9526e39f88 Fix errors in reference manual
Closes gh-24008
2019-11-17 13:50:50 +01:00
Juergen Hoeller 55011e7a0f Note on injecting results from local @Bean methods (self references)
Closes gh-23934
2019-11-13 16:17:01 +01:00
Sam Brannen a276c667d1 Polishing 2019-11-12 13:48:48 +01:00
Rossen Stoyanchev fac9ca891a Fix copy-and-paste error in docs 2019-11-11 17:31:51 +00:00
Rossen Stoyanchev 51b43496f4 Update docs for ASYNC dispatch config
Closes gh-23958
2019-11-11 14:31:53 +00:00
Andy Wilkinson f7bc8c8268 Tidy up classpath pollution caused by resource creation in the tests
Previously, spring-webmvc and spring-webflux both contained tests
that would create gzipped files, write them to the filesystem
alongside the project's compiled test classes, and configure them to
be deleted on JVM exit. The output location placed the files on the
classpath, polluting it for every subsequent test that used the same
ClassLoader. The test-sources plugin combined with Gradle's use of
worker JVMs, broadens the scope of this pollution to other, downstream
projects in the same build. For example, the tests for
spring-websocket will have a different classpath depending on whether
or not the tests for spring-webmvc have already been run on the same
worker as part of the current build.

This commit updates the spring-webmvc and spring-webflux modules to
introduce a new JUnit Jupiter extension, GzipSupport. This extension
allows gzipped files to be created via an injectable GzippedFiles
class and automatically deletes each created file in an after-each
callback. This ensures that a gzipped file only exists on the
classpath for the duration of the test that needs it, avoiding the
pollution of the classpath of any subsequent tests.

Closes gh-23970
2019-11-11 15:11:10 +01:00
Rossen Stoyanchev 1403603b05 Doc update for ForwardedHeaderFilter
Closes gh-23954
2019-11-11 11:44:44 +00:00
Sam Brannen 29185505b1 Polishing 2019-11-09 13:51:28 +01:00
Muhammad Hewedy f638bfc6a9 Fix status code in webmvc.adoc
Closes gh-22396
2019-11-08 17:50:48 +00:00
denisgalaybo b0b6423714 Fixed error in webflux.adoc
Closes gh-23957
2019-11-08 17:19:53 +00:00
방성범 (Bang Seongbeom) 89fc0f2713 Fix typo in docs
Closes gh-23788
2019-11-01 11:57:03 +00:00
Rossen Stoyanchev 5abf24e7d7 Expose maxInMemorySize via CodecConfigurer
Centralized maxInMemorySize exposed via CodecConfigurer along with
ability to plug in an instance of MultipartHttpMessageWrite.

Closes gh-23884
2019-10-29 12:33:16 +00:00
Tomasz Letachowicz 9bbf22a1c9 Typos in WebSocket section
Closes gh-23777
2019-10-23 16:55:00 +01:00
Philippe De Neve ca77342407 Update Spring Boot references in testing documentation
See gh-23848
2019-10-23 09:53:41 +02:00
Minho Hwang d1aee0e869 Fix typo in RSocket reference documentation
This commit fixes a typo in a Java code snippet of
the RSocket reference documentation.

Closes gh-23762
2019-10-06 16:34:27 +02:00
Sam Brannen f16e29892e Add note regarding proxyTargetClass for Java config and web controllers
See gh-23744
2019-10-02 13:11:06 +02:00
Martin Macko 96930924b2 Fixes broken links to dev.java.net
Closes gh-23746
2019-10-02 12:48:34 +02:00
Drummond Dawson b7f819c9e1 Fix URI typo in Java code snippet of web-uris.adoc
Closes gh-23739
2019-10-01 15:10:44 +02:00
Sebastien Deleuze 6080449d03 Polishing 2019-09-27 18:17:23 +02:00
Sam Brannen 4dc966b04b Include @Inject TCK tests in the build again
Commit 979508a7f3 removed the JUnit 4
dependency from all modules except spring-test. Unfortunately, the
@Inject TCK tests (SpringAtInjectTckTests) are still based on JUnit 3.
Thus, that commit accidentally excluded those tests from the build.

This commit includes SpringAtInjectTckTests in the build again by
introducing a test runtime dependency on the JUnit Vintage TestEngine
in spring-context.

See gh-23451
2019-09-27 13:57:31 +02:00
Sam Brannen 6186239287 Remove obsolete references to specific release versions in testing docs 2019-09-26 15:02:30 +02:00
Sam Brannen f05b4625de Merge branch '5.1.x' 2019-09-26 10:55:55 +02:00
Sam Brannen 7d126d3288 Improve documentation regarding "annotated classes"
See gh-23638
2019-09-26 10:26:36 +02:00
Sebastien Deleuze f79cebd53d Add Kotlin samples to RSocket documentation
See gh-23147
2019-09-25 17:04:40 +02:00
Johnny Lim d6d3a9e232 Polish ImportOrderCheck Checkstyle rule
Closes gh-23685
2019-09-24 12:36:51 +02:00
Sebastien Deleuze 840249778a Polish Kotlin reference documentation for WebMvc.fn
See gh-23657
2019-09-24 10:14:16 +02:00
Rossen Stoyanchev 2888b032a1 Polish rsocket.adoc 2019-09-24 06:08:06 +01:00
Rossen Stoyanchev 93371cc2ac Polish 2019-09-23 16:35:08 +01:00
Arjen Poutsma 9ffecc5059 Polish reference documentation for WebMvc.fn 2019-09-23 16:08:50 +02:00
Arjen Poutsma 652bbdad2a Add reference documentation for WebMvc.fn
This commit introduces reference documentation for WebMvc.fn, the
functional web framework.

Closes gh-23657
2019-09-23 15:27:49 +02:00
Rossen Stoyanchev 0ae7154518 Fix checkstyle violation 2019-09-23 13:09:06 +01:00
Rossen Stoyanchev 88bb2aabbf RSocket reference documentation
Closes: gh-23147
2019-09-23 12:18:03 +01:00
Sebastien Deleuze 02d70424ad Mention Kotlin code samples in the Kotlin refdoc 2019-09-19 10:44:50 +02:00
Sebastien Deleuze 1dfe304da4 Improve parity between Java and Kotlin router DSL
This commit adds following functions to the Kotlin DSL:
add, filter, before, after and onError.

Closes gh-23524
2019-09-17 12:42:48 +02:00
Sebastien Deleuze 5a0216d657 Improve parity between Java and Kotlin router DSL
This commit adds variants with pattern + predicate to
Kotlin router DSLs, and vararg where necessary.

Closes gh-23524
2019-09-16 22:14:55 +02:00
Phillip Webb e9454b8b11 Update checkstyle import rule
Update the checkstyle rule to enforce the blank line between `java`
and `javax`.

See gh-23539
2019-09-16 13:45:28 +02:00
Phillip Webb d945ae9191 Add blank line between java and javax imports
See gh-23539

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-09-16 13:41:59 +02:00
Sam Brannen 455ad71863 Polish contribution
See gh-23629
2019-09-12 17:02:35 +02:00
Sebastien Deleuze fc6480631e Improve Coroutines transaction API
As a follow-up of gh-22915, the purpose of this commit is to improve
Coroutines programmatic transaction API to make it more consistent with
the Java one and more idiomatic.

For suspending functions, this commit changes the
TransactionalOperator.transactional extension with a suspending lambda
parameter to a TransactionalOperator.executeAndAwait one which is
conceptually closer to TransactionalOperator.execute Java API so more
consistent.

For Flow, the TransactionalOperator.transactional extension is correct
but would be more idiomatic as a Flow extension.

This commit also adds code samples to the reference documentation.

Closes gh-23627
2019-09-12 14:45:03 +02:00
Sam Brannen 8f38f5c17a Polishing 2019-09-12 11:35:30 +02:00
Sam Brannen 30cff46e7f Prevent improper use of testing framework APIs
Prior to this commit, a lot of work had been done to prevent improper
use of testing Framework APIs throughout the codebase; however, there
were still some loopholes.

This commit addresses these loopholes by introducing additional
Checkstyle rules (and modifying existing rules) to prevent improper use
of testing framework APIs in production code as well as in test code.

- Checkstyle rules for banned imports have been refactored into
  multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
  TestNG.
- Accidental usage of org.junit.Assume has been switched to
  org.junit.jupiter.api.Assumptions.
- All test classes now reside under org.springframework packages.
- All test classes (including abstract test classes) now conform to the
  `*Tests` naming convention.
  - As an added bonus, tests in the renamed
    ScenariosForSpringSecurityExpressionTests are now included in the
    build.
- Dead JUnit 4 parameterized code has been removed from
  DefaultServerWebExchangeCheckNotModifiedTests.

Closes gh-22962
2019-09-12 11:20:56 +02:00
Sam Brannen 2b1ae4af60 Remove obsolete Checkstyle suppression entries 2019-09-05 15:54:55 +02:00
Stephane Nicoll 9afe17a29b Fix static imports handling in IntelliJ IDEA configuration
Closes gh-23588
2019-09-05 14:35:54 +02:00
Sam Brannen 99d88ba14e Document minimum JDK 8 update version
Closes gh-23563
2019-09-05 14:04:43 +02:00
Sebastien Deleuze 40a55b412d Rename BodyBuilder#bodyAndAwait to bodyValueAndAwait 2019-09-05 13:34:11 +02:00
Phillip Webb 6fbd4841ec Update checkstyle import rule
Update the checkstyle rule to enforce the blank line between `java`
and `javax`.

Closes gh-23539
2019-09-04 22:06:46 -07:00
Sebastien Deleuze 2b4eb610a7 Add support for Coroutines transactions
This commit adds Coroutines extensions for
TransactionalOperator.transactional that accept suspending lambda or
Kotlin Flow parameters.

@Transactional on suspending functions is not supported yet, gh-23575
has been created for that purpose.

Closes gh-22915
2019-09-03 23:41:42 +02:00
Sebastien Deleuze f8516c69bf Add Kotlin code snippets to data access refdoc
See gh-21778
2019-09-03 16:03:41 +02:00
Sam Brannen 652db21d3e Ensure Hamcrest imports are properly banned 2019-09-03 16:01:30 +02:00
Arjen Poutsma 4c863f3f83 Revise documentation on using WebClient::exchange
This commit revised the paragraph regarding the need to consume or
release the ClientResponse body when using WebClient::exchange.

Closes gh-23498
2019-09-03 15:44:02 +02:00
康智冬 a6f4862f13 Fix typos related to indefinite articles
Closes gh-23555
2019-09-01 15:45:49 +02:00
Sam Brannen f05f993cc6 Fix formatting in Testing chapter in Reference Manual 2019-08-31 15:07:12 +02:00
Sam Brannen 794e2e328d Polish Testing chapter in Reference Manual 2019-08-31 14:47:49 +02:00
Sebastien Deleuze 3dfd0a24dc Add Kotlin code snippets to WebTestClient testing refdoc
Closes gh-21778
2019-08-31 11:36:57 +02:00
Udo Kohlmeyer b20a8c9d98 Add Kotlin code snippets to testing refdoc
See gh-21778
2019-08-31 11:31:03 +02:00
Sam Brannen ff1f8aa5a8 Add missing parentheses in Testing chapter 2019-08-30 17:19:46 +02:00
Sam Brannen 489193dfa6 Add missing parentheses in Testing chapter 2019-08-30 17:12:23 +02:00
Sebastien Deleuze 52976246ac Remove bodyWithType extension from WebFlux
Since there is no more clash with the new bodyValue
method name.

Closes gh-23523
2019-08-28 13:30:16 +02:00
Sebastien Deleuze 14558844bc Add Kotlin code snippets to WebFlux refdoc
See gh-21778
2019-08-28 11:18:43 +02:00
Sebastien Deleuze 0d3fb0ee0f Add Kotlin code snippets to WebMvc refdoc
See gh-21778
2019-08-22 16:58:00 +02:00
Sam Brannen 53f523001e Focus examples in Testing chapter on JUnit Jupiter 2019-08-21 15:56:15 +02:00
Sam Brannen 3dc4d01b53 Fix heading for Streaming Responses section of Testing chapter 2019-08-21 15:56:15 +02:00
Sam Brannen 6ce5f9da06 Fix unmatched parentheses in @ContextHierarchy example in reference manual
See gh-23487
2019-08-21 14:18:21 +02:00
Brian Clozel 998f6af290 Move integration tests to dedicated module
This commit moves the dependency management and test source files
related to integration tests to a dedicated module.
This allows us to focus the root project on building the Spring
Framework.

See gh-23282
2019-08-19 10:55:44 +02:00
부종민 18eed79d73 Fix typo
See gh-23480
2019-08-18 08:09:56 +02:00
Phillip Webb f8a93ee4a7 Add SpringJUnit5 checkstyle rule
Add `SpringJUnit5` checkstyle rule to ensure that JUnit 4 annotations
aren't accidentally used in new tests.

The "must not be public" rule has been suppressed since there are
quite a few tests that extend base tests from other packages.
2019-08-17 08:31:23 -07:00
Sam Brannen 288461a541 Introduce @EnabledForTestGroups in Spring's test suite
Closes gh-23476
2019-08-17 14:47:24 +02:00
Sam Brannen 504d2a41f1 Polish ScheduledAndTransactionalAnnotationIntegrationTests 2019-08-17 13:12:17 +02:00
Sam Brannen 3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Sebastien Deleuze 76645644b1 Polishing
See gh-21778
2019-08-14 10:06:04 +02:00
Sebastien Deleuze db02d38c89 Restore annotated code samples
See gh-21778
2019-08-14 10:00:16 +02:00
Sebastien Deleuze ec740559ed Store refdoc preferred language
See gh-21778
2019-08-14 10:00:16 +02:00
Sebastien Deleuze eff9cae314 Add global language switch capabilities to the refdoc
See gh-21778
2019-08-13 16:29:47 +02:00
Sebastien Deleuze 32a942fda9 Polishing 2019-08-13 16:29:47 +02:00
Sebastien Deleuze a2b8ea5173 Remove the black border from code samples
See gh-21778
2019-08-13 16:29:47 +02:00
Lars Grefer c863b8994a Improve language-switch CSS
Closes gh-23454
2019-08-13 09:42:08 +02:00
Sebastien Deleuze b52a50a7e0 Use Kotlin extensions for ClassPathXmlApplicationContext refdoc
Closes gh-23456
2019-08-13 09:42:08 +02:00
Sebastien Deleuze f3c7879831 Add missing css file
See gh-21778
2019-08-12 16:23:49 +02:00
Sebastien Deleuze 96658235c8 Add Kotlin code snippets to core refdoc
This commit introduces Kotlin code snippets, for now
in the core reference documentation. Other sections
will follow, as well as improvements like global
language switch.

See gh-21778
2019-08-12 15:45:18 +02:00
Michał Rowicki ee47bc3a25 Fix typo in data access reference documentation
Closes gh-23450
2019-08-12 11:21:54 +02:00
Sam Brannen 1925526df5 Improve reference documentation for ContextClosedEvent
Closes gh-23436
2019-08-09 13:58:31 +02:00
Sam Brannen 0cdf992433 Fix grammar in Integration chapter regarding MDPs 2019-08-09 13:14:46 +02:00
Sam Brannen e4fec9364c Improve reference documentation for @Autowired's required attribute
Prior to this commit, the corresponding documentation was misleading.

Closes gh-23428
2019-08-09 11:37:46 +02:00
Stephane Nicoll 977451064a Merge branch '5.1.x' 2019-08-09 09:37:36 +02:00
Michał Rowicki 806fcb3839 Fix typo
See gh-23437
2019-08-09 09:36:46 +02:00
Rossen Stoyanchev 63bf1bff23 Merge branch '5.1.x' 2019-08-02 16:33:02 +01:00
Rossen Stoyanchev 70be7117f3 Fix link to Spring AMQP and polish
Optimize section headings for dispaly in left hand navigation.
2019-08-02 16:32:01 +01:00
Sam Brannen f53cdb8bd2 Introduce common SimpleUrlHandlerMapping constructors
Prior to this commit, the SimpleUrlHandlerMapping classes in Spring MVC
and Spring Webflux only had default constructors. This lead to the fact
that users often had to explicitly invoke setUrlMap() and setOrder() on
the newly instantiated SimpleUrlHandlerMapping.

In order to simplify the programmatic setup of a SimpleUrlHandlerMapping
in common scenarios, this commit introduces the following constructors.

- SimpleUrlHandlerMapping()
- SimpleUrlHandlerMapping(Map<String, ?> urlMap)
- SimpleUrlHandlerMapping(Map<String, ?> urlMap, int order)

Closes gh-23362
2019-07-28 17:59:19 +02:00
Sam Brannen 0a822ddf2d Fix typo in reference manual 2019-07-28 16:36:12 +02:00
Sam Brannen 1075bae280 Document repeatable @TestPropertySource support in reference manual
See gh-23320
2019-07-27 23:02:43 +02:00