Articles

Managing Grails Database Migrations With Flyway
A database schema is part of a Grails application’s source code, even when it lives in a separate PostgreSQL, MySQL, or MariaDB server. Tables, indexes,…
Localising Grails views with message bundles
A Grails view often begins with English in headings, labels, paragraphs, and validation messages. That is fine for one audience, but changing wording or adding…
Validating Grails Forms with Command Objects
HTML form data is untrusted input, even when the browser has required fields and the page looks correct. Grails provides a useful boundary between transport…
Using Groovy Traits for Cross-Cutting Concerns in Grails Services
Grails services often end up carrying the same handful of responsibilities regardless of the domain they sit in. Logging who did what, checking whether a…
Automating Grails Build with Gradle Composite Builds
A Grails application often begins as a single project, with domain classes, services, controllers and configuration living in one repository. As the codebase…
Building Geb Page Objects for Reliable Grails End-to-End Tests
Geb is a browser automation library that sits comfortably on top of WebDriver and reads almost like ordinary Groovy. For Grails teams, the real payoff comes…
Using Spock Data Tables to Test Grails Controllers
Grails controllers often contain a deceptively large number of decisions. A request may be accepted for one HTTP method, rejected for another, redirected when…
Securing Grails applications with JWT access tokens
JSON Web Tokens (JWTs) give a Grails application a compact way to represent an authenticated user between requests. After a successful login, the server issues…
Building Grails REST APIs With Versioned URL Paths
A REST API rarely stays still. The first release may expose a handful of resources for a web interface, then mobile clients, partner integrations, reporting…
Using Grails with Azure Blob Storage for Remote Files
A Grails application often begins by saving uploaded files to a local images or uploads directory. That approach works during development, but it becomes…