The Grails Framework 6.2.0 (original) (raw)

Table of Contents

1Introduction

1.1What's new in Grails 6?

1.1.1Updated Dependencies

2Getting Started

2.1Installation Requirements

2.2Downloading and Installing

2.3Creating an Application

2.4Creating a Simple Web Application with Grails

2.5Using Interactive Mode

2.6Getting Set Up in an IDE

2.7Grails Directory Structure and Convention over Configuration

2.8Running and Debugging an Application

2.9Testing an Application

2.10Deploying an Application

2.11Supported Java EE Containers

2.12Creating Artefacts

2.13Generating an Application

3Upgrading from the previous versions

3.1Upgrading from Grails 5 to Grails 6

3.2Upgrading from Grails 4 to Grails 5

3.3Upgrading from Grails 3.3.x to Grails 4

4Configuration

4.1Basic Configuration

4.1.1Options for the YML format Config

4.1.2Built in options

4.1.3Logging

4.1.3.1Logger Names

4.1.3.2Masking Request Parameters From Stacktrace Logs

4.1.3.3External Configuration File

4.1.4GORM

4.1.5Configuring an HTTP proxy

4.2The Application Class

4.2.1Executing the Application Class

4.2.2Customizing the Application Class

4.2.3The Application LifeCycle

4.3Environments

4.4The DataSource

4.4.1DataSources and Environments

4.4.2Automatic Database Migration

4.4.3Transaction-aware DataSource Proxy

4.4.4Database Console

4.4.5Multiple Datasources

4.5Versioning

4.6Dependency Resolution

5The Command Line

5.1Interactive Mode

5.2Creating Custom Commands

5.3Creating a Grails Project

6Object Relational Mapping (GORM)

6.1Quick Start Guide

6.1.1Basic CRUD

6.2Further Reading on GORM

7The Web Layer

7.1Controllers

7.1.1Understanding Controllers and Actions

7.1.2Controllers and Scopes

7.1.3Models and Views

7.1.4Redirects and Chaining

7.1.5Data Binding

7.1.6Responding with JSON

7.1.7More on JSONBuilder

7.1.8Responding with XML

7.1.9Uploading Files

7.1.10Command Objects

7.1.11Handling Duplicate Form Submissions

7.1.12Simple Type Converters

7.1.13Declarative Controller Exception Handling

7.2Groovy Server Pages

7.3URL Mappings

7.3.1Mapping to Controllers and Actions

7.3.2Mapping to REST resources

7.3.3Redirects In URL Mappings

7.3.4Embedded Variables

7.3.5Mapping to Views

7.3.6Mapping to Response Codes

7.3.7Mapping to HTTP methods

7.3.8Mapping Wildcards

7.3.9Automatic Link Re-Writing

7.3.10Applying Constraints

7.3.11Named URL Mappings

7.3.12Customizing URL Formats

7.3.13Namespaced Controllers

7.4CORS

7.5Interceptors

7.5.1Defining Interceptors

7.5.2Matching Requests with Interceptors

7.5.3Ordering Interceptor Execution

7.6Content Negotiation

8Traits

8.1Traits Provided by Grails

8.1.1WebAttributes Trait Example

9REST

9.1Domain classes as REST resources

9.2Mapping to REST resources

9.3Linking to REST resources from GSP pages

9.4Versioning REST resources

9.5Implementing REST controllers

9.5.1Extending the RestfulController super class

9.5.2Implementing REST Controllers Step by Step

9.5.3Generating a REST controller using scaffolding

9.6Calling REST Services with HttpClient

9.7The REST Profile

9.8JSON Views

9.8.1Getting Started

9.8.2Creating JSON Views

9.8.3JSON View Templates

9.8.4Rendering Domain Classes with JSON Views

9.8.5JSON Views by Convention

9.9Customizing Response Rendering

9.9.1Customizing the Default Renderers

9.9.2Implementing a Custom Renderer

9.9.3Using GSP to Customize Rendering

9.10Hypermedia as the Engine of Application State

9.10.1HAL Support

9.10.2Atom Support

9.10.3Vnd.Error Support

9.11Customizing Binding of Resources

9.12RSS and Atom

10Asynchronous Programming

11Validation

11.1Declaring Constraints

11.2Validating Constraints

11.3Sharing Constraints Between Classes

11.4Validation on the Client

11.5Validation and Internationalization

11.6Applying Validation to Other Classes

12The Service Layer

12.1Declarative Transactions

12.1.1Transactions and Multi-DataSources

12.1.2Transactions Rollback and the Session

12.2Scoped Services

12.3Dependency Injection and Services

13Static Type Checking And Compilation

13.1The GrailsCompileStatic Annotation

13.2The GrailsTypeChecked Annotation

14Testing

14.1Unit Testing

14.2Integration Testing

14.3Functional Testing

15Internationalization

15.1Understanding Message Bundles

15.2Changing Locales

15.3Reading Messages

15.4Scaffolding and i18n

16Security

16.1Securing Against Attacks

16.2Cross Site Scripting (XSS) Prevention

16.3Encoding and Decoding Objects

16.4Authentication

16.5Security Plugins

16.5.1Spring Security

17Plugins

17.1Creating and Installing Plugins

17.2Plugin Repositories

17.3Providing Basic Artefacts

17.4Evaluating Conventions

17.5Hooking into Runtime Configuration

17.6Adding Methods at Compile Time

17.7Adding Dynamic Methods at Runtime

17.8Participating in Auto Reload Events

17.9Understanding Plugin Load Order

17.10The Artefact API

17.10.1Asking About Available Artefacts

17.10.2Adding Your Own Artefact Types

18Grails and Spring

18.1Configuring Additional Beans

18.2Runtime Spring with the Beans DSL

18.3The BeanBuilder DSL Explained

18.4Property Placeholder Configuration

18.5Property Override Configuration

18.6Spring Boot Actuators

19Scaffolding

20Deployment

20.1Standalone

20.2Container Deployment (e.g. Tomcat)

20.3Deployment Configuration Tasks

21Contributing to Grails

21.1Report Issues in Github's issue tracker

21.2Build From Source and Run Tests

21.3Submit Patches to Grails Core

21.4Submit Patches to Grails Documentation