What problem does it solve?
Centralizes access to request data and response control in ColdBox by providing clear patterns for reading and writing public and private request collections, inspecting HTTP metadata, handling AJAX and REST payloads, and managing flash-scoped data across redirects.
Core Features & Use Cases
- Request collection management: Read and write rc (public) and prc (private) collections, use event.getValue and event.getPrivateValue for defaults and existence checks.
- HTTP introspection and body parsing: Detect HTTP methods, check isAjax/isSSL, read headers and raw or JSON bodies for REST handlers.
- Response control and navigation: Render views with or without layouts, render JSON responses, set headers and status codes, suppress rendering, and relocate/redirect including named and external routes.
- URL generation and flash patterns: Build links reliably with buildLink, persist ephemeral data across redirects with flash (including persistence and clearing), and implement PRG and AJAX-response patterns.
- Use Case: Implement a listing that returns JSON for AJAX requests and full HTML for normal requests while safely populating prc for views and preserving form errors in flash across a redirect.
Quick Start
In a handler, use event.getValue to read parameters, set prc.user from your userService, use flash.put to store one-request messages if needed, and call event.setView to render the target template.