Play Framework 3.0

Last reviewed Oct 11, 2026

Export as PDF

Prompt Details

Prompt Composition

3prompts
  1. Java 21124 lines · 3.9K tokens
  2. Scala 3.349 lines · 1.3K tokens
  3. Play Framework 3.094 lines · 6K tokens
Total267 lines · 11.2K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 88
  • 89
  • 95
  • 113
  • 117
  • 190
  • 197
  • 201
  • 204
  • 208
  • 209
  • 214
  • 295
  • 297
  • 306
  • 307
  • 319
  • 323
  • 327
  • 338
  • 346
  • 347
  • 352
  • 362
  • 367
  • 378
  • 384
  • 427
  • 434
  • 444
  • 459
  • 470
  • 471
  • 476
  • 488
  • 489
  • 494
  • 502
  • 524
  • 525
  • 532
  • 552
  • 598
  • 601
  • 611
  • 613
  • 614
  • 653
  • 674
  • 681
  • 732
  • 749
  • 759
  • 770
  • 772
  • 776
  • 789
  • 807
  • 862
  • 863
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1004
  • 1275
  • 1333

Prompt Preview

Apply the Scala 3.3 prompt and its Java 21 baseline first. These rules cover Play Framework 3.0's Scala APIs and Twirl. Java 21 is within the line's documented Java 11, 17, and 21 LTS support. Use org.apache.pekko APIs and the corresponding pekko.* and play.server.pekko.* configuration for Play 3.0.

Routes, filters, and authorization

  • Preserve CSRFFilter, SecurityHeadersFilter, and AllowedHostsFilter when customizing filters. Append with play.filters.enabled +=; a root Filters class, explicit play.http.filters, replacement enabled list, or disabled PlayFilters plugin can remove defaults. Include HttpFiltersComponents when using compile-time dependency injection.
  • Keep policy coverage when implementing HttpRequestHandler or filters: routing precedes filtering, and invoking another action directly from a filter skips the remaining chain. Delegate through the configured handler and filter pipeline for alternate routes and errors.
  • Review first-match route ordering, mounted routers, and fallback handlers. Validate wildcard *path and regex route parameters explicitly: these are not decoded on input or encoded by reverse routing, unlike ordinary :id segments. Avoid decoding a value twice or allowing raw reverse-route parameters to change URL structure.
  • Compose authenticated ActionBuilder, ActionRefiner, and ActionFilter implementations with andThen; derive identity from verified credentials and load each object within the authorized tenant before checking its current permissions. Security.Authenticated is a helper, not an