Commit Graph

150 Commits

Author SHA1 Message Date
rstoyanchev f4f89aa2a4 Add headers to data binding values
Closes gh-32676
2024-06-05 11:30:32 +01:00
Sébastien Deleuze f62275d674 Merge branch '6.1.x' 2024-05-23 16:05:54 +02:00
Attacktive 73eb6f0660 Complete a Kotlin code snippet in the refdoc
Closes gh-32877
2024-05-23 16:03:34 +02:00
rstoyanchev 89dd247b97 Improve docs on controller method validation
Closes gh-32807
2024-05-22 17:15:54 +01:00
rstoyanchev 1ddc84862e Improve docs on controller method validation
Closes gh-32807
2024-05-22 17:12:09 +01:00
Brian Clozel 4d4b343815 Support Content Negotiation with @ExceptionHandler
Prior to this commit, `@ExceptionHandler` annotated controller methods
could be mapped using the exception type declaration as an annotation
attribute, or as a method parameter.
While such methods support a wide variety of method arguments and return
types, it was not possible to declare the same exception type on
different methods (in the same controller/controller advice).

This commit adds a new `produces` attribute on `@ExceptionHandler`; with
that, applications can vary the HTTP response depending on the exception
type and the requested content-type by the client:

```
@ExceptionHandler(produces = "application/json")
public ResponseEntity<ErrorMessage> handleJson(IllegalArgumentException exc) {
	return ResponseEntity.badRequest().body(new ErrorMessage(exc.getMessage(), 42));
}

@ExceptionHandler(produces = "text/html")
public String handle(IllegalArgumentException exc, Model model) {
	model.addAttribute("error", new ErrorMessage(exc.getMessage(), 42));
	return "errorView";
}
```

This commit implements support in both Spring MVC and Spring WebFlux.

Closes gh-31936
2024-05-20 17:22:30 +02:00
Juergen Hoeller 7c534eeeeb Merge branch '6.1.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2024-05-14 22:02:32 +02:00
Juergen Hoeller e509385eae Add InputStreamResource(InputStreamSource) constructor for lambda expressions
Includes notes for reliable InputStream closing, in particular with Spring MVC.

Closes gh-32802
2024-05-14 21:59:42 +02:00
Brian Clozel 80ec951fcf Merge branch '6.1.x' 2024-05-13 13:15:01 +02:00
Brian Clozel 09b8feadc2 Document streaming/collecting behavior for Flux return values
Closes gh-32630
2024-05-13 13:12:53 +02:00
rstoyanchev 10e3d3b434 Merge branch '6.1.x' 2024-05-13 11:41:22 +01:00
rstoyanchev d03ea0bf19 Update docs on HandlerInterceptor
Closes gh-32729
2024-05-13 11:40:32 +01:00
Brian Clozel 5cb4985234 Merge branch '6.1.x' 2024-05-13 10:44:09 +02:00
Brian Clozel 89ce63f1f3 Replace RFC7807 by RFC9457 in documentation
This commit updates all references to RFC7807 by RFC9457 since the
former is now obsolete.

Closes gh-32806
2024-05-13 10:42:35 +02:00
Sébastien Deleuze 246f291f67 Use code includes and tabs in WebSocket documentation
See gh-22171
2024-04-09 12:21:36 +02:00
Sébastien Deleuze 8af3eb1aea Polishing
See gh-22171
2024-04-02 13:33:29 +02:00
Sébastien Deleuze bede619e7d Refine `@EnableWebFlux` documentation
This commit refines the documentation related to `@EnableWebFlux` in
order to make it more relevant for modern Boot applications.

See gh-22171
2024-04-02 11:48:12 +02:00
Stéphane Nicoll 81bc586e15 Merge branch '6.1.x' 2024-04-02 09:34:39 +02:00
kexin.an 640b97f33c Polish reference guide
See gh-32557
2024-04-02 09:29:55 +02:00
Sébastien Deleuze 91bb7d8daf Use code includes and tabs in MVC Config documentation
This commit also refines the documentation related to
`@EnableWebMvc` in order to make it more relevant for modern Boot
applications.

See gh-22171
2024-03-29 17:58:01 +01:00
Stéphane Nicoll 875037c431 Merge branch '6.1.x' 2024-03-15 08:28:24 +01:00
Stéphane Nicoll dfc1b839f3 Polish "Fix default strategy description of ProblemDetail error codes"
See gh-32446
2024-03-15 08:27:59 +01:00
Linor Dolev 302c24aaa8 Fix default strategy description of ProblemDetail error codes
See gh-32446
2024-03-15 08:02:20 +01:00
Sébastien Deleuze 460ffbc0f6 Use code includes and tabs in mvc-controller/ann.adoc
See gh-22171
2024-03-12 19:18:42 +01:00
Sébastien Deleuze 9cc74e78f8 Refine "Redirecting to a resource" section code sample
The commit updates the code sample to use a null element friendly list.

Closes gh-32423
2024-03-12 12:22:37 +01:00
rstoyanchev f9883d8bd6 Polishing contribution
Closes gh-31970
2024-03-12 10:43:31 +00:00
injae-kim 76d00d78db Support splitting STOMP messages in WebSocketStompClient
See gh-31970
2024-03-12 10:43:31 +00:00
ZeroCyan 5dc1190930
Fix typo in web documentation
Fixed a small typo.

Closes gh-32407
2024-03-10 16:50:00 +01:00
rstoyanchev 38d5c0fed6 Add RFC-7807 response interception
Closes gh-31822
2024-03-08 16:56:38 +00:00
Tadaya Tsuyukubo 5bd1c1fddb Add ThreadLocalAccessor for LocaleContext and RequestAttributes
Add `ThreadLocalAccessor` implementations:
- `LocaleThreadLocalAccessor`
- `RequestAttributesThreadLocalAccessor`

See gh-32243
2024-02-15 15:49:55 +01:00
Stéphane Nicoll 48da9524c3 Polish 2024-02-14 02:40:02 +01:00
Sam Brannen 10bc93c058 Polishing 2024-02-13 17:22:35 +01:00
Sébastien Deleuze 8c3fc8c549 Add documentation for functional resource handling
Closes gh-27257
2024-02-13 13:36:48 +01:00
Yanming Zhou 6b3bf554ce Fix typo
Introduced by commit f9726ae0c8

Closes gh-32111
2024-01-25 08:32:43 +01:00
rstoyanchev f9726ae0c8 Update description of web validation in docs
Closes gh-32082
2024-01-24 12:41:05 +00:00
Sam Brannen 699da7c383 Log warning if multiple @⁠RequestMapping annotations are declared
If multiple request mapping annotations are discovered, Spring MVC and
Spring WebFlux now log a warning similar to the following (without
newlines).

Multiple @⁠RequestMapping annotations found on
void org.example.MyController.put(), but only the first will be used:
[
@⁠org.springframework.web.bind.annotation.PutMapping(consumes={}, headers={}, name="", params={}, path={"/put"}, produces={}, value={"/put"}),
@⁠org.springframework.web.bind.annotation.PostMapping(consumes={}, headers={}, name="", params={}, path={"/put"}, produces={}, value={"/put"})
]

Closes gh-31962
2024-01-17 17:46:31 +01:00
Sam Brannen 5bf74cae11 Polish documentation for @⁠RequestMapping 2024-01-17 17:46:26 +01:00
Sam Brannen 46128cb4b9 Delete duplicate content 2024-01-17 17:45:17 +01:00
rstoyanchev 65cb59517d Polishing contribution
Closes gh-32008
2024-01-12 15:15:59 +00:00
Olga MaciaszekSharma b729008f4d Improve docs on server use of @HttpExchange
See gh-32008
2024-01-12 15:15:59 +00:00
Suhas Kowligi f4a9b12340 Add missing preposition
See gh-31977
2024-01-08 13:00:13 +01:00
Juergen Hoeller a338a16b29 Polishing 2023-12-27 23:23:38 +01:00
Gabriel Ramirez d919930d83
Fix link text in WebFlux @⁠HttpExchange section of reference docs
Closes gh-31796
2023-12-08 18:31:17 +01:00
Sam Brannen fdcea58a53 Polishing 2023-12-06 12:36:04 +01:00
Sébastien Deleuze 2e3d13331a Document `@ModelAttribute` usage with native images
Closes gh-31765
2023-12-06 12:13:33 +01:00
rstoyanchev 54ecbb2bc8 Update link to stompjs library
Closes gh-28409
2023-11-27 10:28:14 +00:00
rstoyanchev 03b9edc36e Update STOMP WebSocket transport reference docs
Closes gh-31616
2023-11-22 15:20:56 +00:00
Simon Baslé 8567402969
Extract recurring asciidoc links to attributes, cleanup old doc files
This commit extract spring-related links and recurring external links
into asciidoctor attributes to be used by the Antora toolchain.

It notably homogenizes links to:
 - IETF RFCs
 - Java Community Process JSRs
 - the Java API Documentation (on the Java 17 version)
 - Kotlin documentations (on the Kotlinlang.org version)
 - the Spring Boot reference guide (on the `html` version)

This commit also reworks most link attributes to follow a
Project-Category-Misc syntax. For example, `spring-boot-docs` rather
than `docs-spring-boot`.

Finally, it makes an effort to clean up remainders from the previous
documentation toolchain, namely the `docs/asciidoc` folder and 
`modules/ROOT/pages/attributes.adoc` file.

Closes gh-26864
Closes gh-31619
2023-11-21 15:59:24 +01:00
Sam Brannen 4b5cb5fa2e Fix additional WebFlux-related links
See gh-31632
2023-11-20 16:22:35 +01:00
star_Ho f02e231406 Fix link to Spring WebFlux chapter
The description is for WebFlux, but the link points to WebFlux unit
testing support.

This commit changes the link to point the the WebFlux chapter.

Closes gh-31632
2023-11-20 15:55:45 +01:00
rstoyanchev 93528b60d7 Polishing
Closes gh-31491
2023-10-25 13:22:41 +01:00
Rob Winch 03d286c4a1 Document X-Forwarded-* Headers
Previously the documentation assumed that the readers knew how to use
the X-Forwarded-* headers. This commit documents details & examples
of how to use the X-Forwarded-* headers.

See gh-31491
2023-10-25 13:22:41 +01:00
rstoyanchev 3277b0d6ac Handle STOMP messages to user destination in order
Closes gh-31395
2023-10-11 12:16:04 +01:00
Brian Clozel f0686094ff Merge branch '6.0.x' 2023-09-22 11:33:30 +02:00
Brian Clozel 0f92ba1663 Fix typo in ref docs for pattern comparison
Closes gh-31294
2023-09-22 11:32:50 +02:00
rstoyanchev 1f8913a96c Support Jetty WebSocket server parameters
Closes gh-30344
2023-09-13 09:34:07 +01:00
Sébastien Deleuze dfd631e662 Merge branch '6.0.x' 2023-09-11 18:10:13 +02:00
Sébastien Deleuze c892ce5537 Refine CORS documentation for wildcard processing
This commit adds a reference documentation section dedicated
to CORS credentialed requests and related wildcard processing.

Closes gh-31143
2023-09-11 18:07:47 +02:00
rstoyanchev b0d4931d5d Merge branch '6.0.x' 2023-09-08 10:07:35 +01:00
rstoyanchev 740f3b797f Polishing
See gh-31185
2023-09-08 10:07:21 +01:00
rstoyanchev e0c4347cc6 Merge branch '6.0.x' 2023-09-08 09:18:24 +01:00
rstoyanchev eda35e8074 Add note to the interceptor section of the MVC config
Closes gh-31185
2023-09-08 09:17:59 +01:00
Marten Deinum acd34df0d5 Fix WebFlux blocking configuration documentation
BlockingExecutionConfigurer#setExecutor takes an AsyncTaskExecutor
not an Executor as the documentation states. With this commit,
this has been corrected.

Closes gh-31150
2023-09-01 10:29:47 +02:00
Sébastien Deleuze 3ccbe3d1cb Refine documentation contribution
Closes gh-28758
2023-08-28 12:14:35 +02:00
Nheyll 411b355f2c Document buffering with a WebClient filter
See gh-28758
2023-08-28 12:14:28 +02:00
rstoyanchev 5115684baf Revise docs for server use of `@HttpExchange`
Closes gh-30980
2023-08-04 18:21:42 +03:00
Olga MaciaszekSharma d1d5b54f12 Support @HttpExchange for server-side handling
See gh-30980
2023-08-04 18:21:42 +03:00
rstoyanchev 8513ec7440 Update documentation for data binding improvements
Closes gh-30952
2023-08-02 17:21:33 +03:00
Rossen Stoyanchev 667eb42a63 Polishing
See gh-30952
2023-08-01 07:50:06 +03:00
rstoyanchev 73c06347be Update WebMvc docs on use of AsyncTaskExecutor
Closes gh-30905
2023-07-18 10:42:27 +01:00
Sam Brannen e6d360c1c6 Polishing 2023-07-15 12:58:18 +02:00
rstoyanchev b016f385e1 Add BlockingExecutionConfigurer to WebFlux config
Closes gh-30678
2023-07-12 16:55:02 +01:00
Sébastien Deleuze 950c43b4e7 Merge branch '6.0.x' 2023-07-11 14:07:34 +02:00
Sébastien Deleuze a275d942d2 Update STOMP documentation with the new guidelines
This commit changes the documentation to advise using
https://github.com/stomp-js/stompjs library on client
side and to configure by default WebSocket without
SockJS as browsers and proxies now have a pretty good
WebSocket support.

Closes gh-30857
2023-07-11 14:07:15 +02:00
Sam Brannen 02ba06953f Polish grammar and formatting 2023-07-06 17:21:30 +02:00
Brian Clozel df22ba39f8 Warn against direct usage of Servlet API in WebFlux apps
Closes gh-28872
2023-07-06 17:11:24 +02:00
Brian Clozel 430a24e6bc Further document ShallowEtagHeaderFilter limitations
This commit improves the documentation for the
`ShallowEtagHeaderFilter`, stating that it is only meant to support a
subset of conditional HTTP requests: GET requests with "If-None-Match"
headers. Other headers and state changing HTTP methods are not supported
here, as the filter only operates on the content of the response and has
no knowledge of the resource being served.

Closes gh-30517
2023-07-06 09:39:57 +02:00
rstoyanchev ac11b03cd3 Document customization of method validation errors
Closes gh-30653
2023-07-07 21:31:58 +01:00
rstoyanchev df2617d575 Document method validation improvements
Closes gh-30643
2023-07-05 17:07:30 +01:00
Arjen Poutsma 8691173fd8 Create RestClient documentation placeholder
This commit creates a placeholder for future RestClient reference
documentation. It also creats a link to RestClient from the RestTemplate
javadoc.

See gh-30826
2023-07-07 14:14:59 +02:00
Sam Brannen 1901b708b2 Merge branch '6.0.x' 2023-07-06 17:21:49 +02:00
Brian Clozel 3a0e5c8894 Merge branch '6.0.x' 2023-07-06 17:12:05 +02:00
Brian Clozel 8e9528de13 Merge branch '6.0.x' 2023-07-06 09:40:13 +02:00
rstoyanchev 089d938e15 Set throwExceptionIfNoHandlerFound=true and deprecate
Closes gh-29491
2023-06-19 17:18:09 +01:00
rstoyanchev 9c7b5cb3f5 Add ProblemDetail "type" message code
See gh-30566
2023-06-14 16:30:15 +01:00
Sam Brannen e8ab53e76d Polishing 2023-06-01 14:57:50 +02:00
rstoyanchev 7629ea5672 Update docs to mention Boot's HttpMessageConverters
Closes gh-30538
2023-05-30 17:17:31 +01:00
Arjen Poutsma a133aae8d6 Document @ResponseStatus behavior
This commit documents that the ResponseStatus annotation does not
override the status set through other means.

Closes gh-30305
See gh-18019
2023-05-09 14:01:33 +02:00
Rob Winch 3a0a19cff8 Fix migration to asciidoctor tabs
The automation to asciidoctor tabs did not migrate properly for all
cases this commit fixes the migration.

See gh-30435
2023-05-09 12:15:43 +01:00
Rob Winch 39146f9066 Migrate to Asciidoctor Tabs 2023-05-04 15:35:05 +01:00
Rob Winch 7b0ba0188f Structural Fixes 2023-05-04 15:35:05 +01:00
Rob Winch 3774e9be7a Trim IDs with parent 2023-05-04 15:35:05 +01:00
Rob Winch d8bcbd53e1 Fix invalid attributes 2023-05-04 15:35:05 +01:00
Rob Winch 35229c8bff Enable Section Summary TOC for small pages 2023-05-04 15:35:05 +01:00
Rob Winch 139cde47e2 Fix cross references 2023-05-04 15:35:05 +01:00
Rob Winch 6b341ddf19 Remove includes 2023-05-04 15:35:05 +01:00
Rob Winch 9f49d24833 Split files 2023-05-04 15:35:05 +01:00
Rob Winch 7f9061a3cb Fix image::image 2023-05-04 15:35:05 +01:00
Rob Winch 9ceb75b228 Insert explicit ids for headers 2023-05-04 15:35:05 +01:00
Rob Winch 3fe7c65218 Migrate Structure 2023-05-04 15:35:05 +01:00