controllers

Purpose

A plug-in that sets up core Grails MVC architecture using the underlying Spring MVC component model

Examples

A controller:


class BookController {
	def list = {
		books:Book.list()
	}
}

A tag library:


import java.text.*
class FormatTagLib {
	def dateFormat = { attrs ->
		out << new SimpleDateFormat(attrs.format).format(attrs.value)
	}
}

Description

This plug-in deals with setting up Grails to use Spring MVC at its core to deal with web requests. The plug-in sets up the GrailsDispatcherServlet and necessary Spring beans (see below) for controllers, tag libraries and Groovy Server Pages (GSP)

Configured Spring Beans:

The plug-in will also configure each Grails controller class as a prototyped Spring bean and each Grails tag library as a singleton Spring bean