create-controller

Purpose

The create-controller command creates a controller and associated unit test for the given base name.

Examples

grails create-controller org.bookstore.book

Description

Creates a controller for the given base name. For example for a base name "org.bookstore.book" a controller called BookController will be created in the grails-app/controllers/org/bookstore directory.

A controller is responsible for handling incoming web requests and performing actions such as redirects, rendering views and so on. For more information on controllers refer to the section on Controllers

Note that this command is just for convenience and you can also create controllers in your favourite text editor or IDE if you choose.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource