Spring MVC 7.0

Last reviewed Oct 11, 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 MVC 7.060 lines · 1.8K tokens
Total305 lines · 9.6K tokens

CWE Coverage

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

Prompt Preview

Apply the Spring Boot 4.1 baseline first. These rules cover Spring Framework MVC 7.0.9.

Routing and binding

  • Bind request data to dedicated command objects, not persistence entities, keeping tenant and approval-state fields, as well as the baseline's server-owned fields, out of the writable model.
  • Use WebDataBinder.setAllowedFields and setDeclarativeBinding(true) for explicit property binding, and @ModelAttribute(binding=false) when an existing object must not be rebound.
  • Cap request parameter counts and collection sizes before binding, alongside the Spring Framework auto-growth limits.
  • Validate path, query, header, cookie, form, multipart, and JSON values after conversion, including cross-field and authorization invariants.
  • Reject BindingResult or Errors failures before business logic; an adjacent error argument lets the controller run with that argument's validation errors.
  • Constrain @RequestBody deserialization through its HttpMessageConverter and DTO; WebDataBinder allowed fields do not filter JSON or XML properties.
  • Map routes and HTTP methods explicitly and reject unsupported content types before selecting a converter or allocating large request objects.

Authorization and dispatch behavior

  • Authorize the resolved object and transition inside the service transaction; a mapped controller, path variable, or successful converter does not prove ownership.
  • Cover REQUEST, ASYNC, ERROR, and FORWARD dispatches in security-filter registration and security rules so an error page, forward, or resumed async request cannot bypass