Spring WebFlux 7.0

Last reviewed Sep 25, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. Java 25113 lines · 2.8K tokens
  2. Spring Framework 7.070 lines · 2.4K tokens
  3. Spring Boot 4.162 lines · 2.7K tokens
  4. Spring WebFlux 7.078 lines · 3.5K tokens
Total323 lines · 11.4K tokens

CWE Coverage

  • 15
  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 116
  • 117
  • 190
  • 201
  • 208
  • 209
  • 214
  • 250
  • 295
  • 297
  • 306
  • 319
  • 323
  • 327
  • 338
  • 346
  • 347
  • 352
  • 362
  • 367
  • 378
  • 384
  • 409
  • 427
  • 470
  • 471
  • 488
  • 494
  • 502
  • 524
  • 532
  • 552
  • 611
  • 613
  • 614
  • 653
  • 681
  • 732
  • 749
  • 770
  • 772
  • 776
  • 789
  • 807
  • 829
  • 862
  • 863
  • 913
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1275
  • 1333

Prompt Preview

Apply the Spring Boot 4.1 and Java 25 prompts first. These rules cover Spring Framework 7.0.9 WebFlux controllers, functional endpoints, codecs, WebClient, sessions, and streaming. The framework retains a Java 17 minimum; these rules target Java 25.

Routing and binding

  • Constrain @ModelAttribute and ServerRequest.bind with dedicated input types and WebDataBinder.setDeclarativeBinding(true); explicitly allowlist setter-bound fields with setAllowedFields where needed. These binder settings do not restrict JSON deserialization through @RequestBody.
  • Authorize resource and tenant identifiers from the intended input source independently of bound model fields: @ModelAttribute combines form data, query parameters, URI variables, and headers, with form and query values taking precedence over matching URI variables or headers.
  • Apply @Valid or @Validated to annotated command objects and explicit constraints to scalar parameters. Check an adjacent Errors or BindingResult before doing work; declaring one can transfer validation-error handling to the controller.
  • Handle both WebExchangeBindException and HandlerMethodValidationException; @Valid alone does not activate method validation. Remove class-level @Validated when relying on WebFlux's built-in controller method validation instead of AOP validation.
  • Invoke a configured Validator explicitly in functional handlers after bodyToMono or for each bodyToFlux element, before persistence or other side effects; decoding a DTO does not itself enforce its Bean Validation constraints.
  • Declare