Split files

This commit is contained in:
Rob Winch
2023-04-19 10:26:16 -05:00
committed by rstoyanchev
parent ac69a5dac3
commit 9f49d24833
391 changed files with 62477 additions and 62392 deletions

View File

@@ -0,0 +1,39 @@
[[webflux-controller]]
= Annotated Controllers
[.small]#<<web.adoc#mvc-controller, See equivalent in the Servlet stack>>#
Spring WebFlux provides an annotation-based programming model, where `@Controller` and
`@RestController` components use annotations to express request mappings, request input,
handle exceptions, and more. Annotated controllers have flexible method signatures and
do not have to extend base classes nor implement specific interfaces.
The following listing shows a basic example:
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
@RestController
public class HelloController {
@GetMapping("/hello")
public String handle() {
return "Hello WebFlux";
}
}
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
@RestController
class HelloController {
@GetMapping("/hello")
fun handle() = "Hello WebFlux"
}
----
In the preceding example, the method returns a `String` to be written to the response body.