O'Reilly logo

The Definitive Guide to Grails 2 by Graeme Rocher, Jeff Scott Brown

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

Image

Understanding Controllers

A Grails controller is a class that is responsible for handling requests coming in to the application. The controller receives a request, potentially does some work with the request, and finally decides what should happen next. What happens next might include the following:

  • executing another controller action (possibly but not necessarily in the same controller)
  • rendering a view
  • rendering information directly to the response

A controller is prototyped by default, meaning that a new instance is created for each request, so developers don’t need to be as cautious about maintaining thread-safe code in a singleton ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required